Skip to content

Commit

Permalink
try fix image comparison tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed May 18, 2024
1 parent 6adde4c commit 11a1fa6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def img_similarity(expected, to_compare):
"""
img_a, img_b = resize_image_to_match(expected, to_compare)
io.imsave(str(expected.parent / f'resized_{expected.name}'), img_a)
# reshape img_a to match img_b - fix spurious failures on github actions
img_b = img_a.reshape(img_b.shape[0], img_b.shape[1], img_b.shape[2])
err = np.sum((img_a.astype("float") - img_b.astype("float")) ** 2)
err /= float(img_a.shape[0] * img_a.shape[1])
return err
Expand Down

0 comments on commit 11a1fa6

Please sign in to comment.