Skip to content
Snippets Groups Projects
Commit a6e2130c authored by Michael Langguth's avatar Michael Langguth
Browse files

Added flexibilty regarding ssmi-import statement from skimage in metrics.py.

parent 655aa68e
No related branches found
No related tags found
No related merge requests found
Pipeline #71617 failed
......@@ -2,7 +2,16 @@ import tensorflow as tf
#import lpips_tf
import math
import numpy as np
try:
from skimage.measure import compare_ssim as ssim_ski
except:
try:
import skimage.metrics._structural_similarity as ssmi_ski
except ModuleNotFoundError as err:
print("Could not get ssmi-function from skimage. Please check installed skimage-package.")
raise err
def mse(a, b):
return tf.reduce_mean(tf.squared_difference(a, b), [-3, -2, -1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment