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

Merge branch 'michael_issue#121_flexibility_skimage_ssmi' into develop

parents 655aa68e a6e2130c
No related branches found
No related tags found
No related merge requests found
Pipeline #71619 failed
...@@ -2,7 +2,16 @@ import tensorflow as tf ...@@ -2,7 +2,16 @@ import tensorflow as tf
#import lpips_tf #import lpips_tf
import math import math
import numpy as np import numpy as np
try:
from skimage.measure import compare_ssim as ssim_ski 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): def mse(a, b):
return tf.reduce_mean(tf.squared_difference(a, b), [-3, -2, -1]) 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