fix!: bump ssim, swap to multichannel
Browse files
app.py
CHANGED
@@ -67,8 +67,8 @@ def compare_face_ssim(img1, img2, face_area):
|
|
67 |
if face2.dtype != np.float32:
|
68 |
face2 = face2.astype(np.float32) / 255.0
|
69 |
|
70 |
-
# Calculate SSIM
|
71 |
-
ssim_value =
|
72 |
return ssim_value
|
73 |
|
74 |
def predict_and_compare(image):
|
@@ -145,7 +145,7 @@ Authentication Report:
|
|
145 |
Permission denied (publickey,facial).
|
146 |
Connection to husseumi.space closed.
|
147 |
"""
|
148 |
-
return success if ssim_value>=0.
|
149 |
|
150 |
finally:
|
151 |
# Cleanup
|
|
|
67 |
if face2.dtype != np.float32:
|
68 |
face2 = face2.astype(np.float32) / 255.0
|
69 |
|
70 |
+
# Calculate multichannel SSIM
|
71 |
+
ssim_value = ssim(face1, face2, data_range=1.0, multichannel=True)
|
72 |
return ssim_value
|
73 |
|
74 |
def predict_and_compare(image):
|
|
|
145 |
Permission denied (publickey,facial).
|
146 |
Connection to husseumi.space closed.
|
147 |
"""
|
148 |
+
return success if ssim_value>=0.96 and predicted_class == 'True' else fail
|
149 |
|
150 |
finally:
|
151 |
# Cleanup
|