Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make image similarity check less sensitive (#258)
Summary: Pull Request resolved: #258 as part of my personal side quest to make augly's tests pass again, i am making a change to our tests. currently, to assess image similarity, we use the `np.allclose` function. while that's better / less sensitive than an MD5 hash it's not much better because imperceptible changes can actually have large differences in values between numpy image arrays. thus, to make augly's tests less affected by slight version updates by PIL or whatever else, we are switching to using imagehash. we're specifically using the phash - you can read about it here: https://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html phash isn't a perfect fit though, long term. it's not sensitive to color, scaling, or aspect ratio changes. to deal with the latter two, im keeping in the size equality check. for color, i want to do some more research on what is an efficient way to do this. nonetheless, this is still better than what we currently have right now. Differential Revision: D70137163
- Loading branch information