[py-tx][mlh] Add rotation reference to brute force lookup #1665
Labels
mlh
Related to Major League Hacking Fellowship
python-threatexchange
Items related to the threatexchange python tool / library
This is a small-to-medium project.
You will learn about:
Images have multiple "primitive" rotations:
Some algorithms like pdq can generate multiple rotations at once as they hash. You can see the rotations implemented here: https://github.com/facebook/ThreatExchange/blob/main/pdq/cpp/hashing/pdqhashing.cpp#L440-L456
Goal
The reference brute force approach in
tx match
should also try rotations, and pick the minimum distance. Which rotation it used should be returned in the distance stringPossible Solutions
Add a new mixin for hashing rotations
This is similar to what we did for many exceptional cases for SignalType, we can add a new class called
SignalTypeWithRotations
which has a `.hash_rotations(file_ptr)Note that this doesn't (yet) affect the index matching, which we will save for later.
Code
Tests
tx match
or the HMA upload debugger to demonstrate the interface is being used correctlyThe text was updated successfully, but these errors were encountered: