Installing using pip install opencv-python perception as mentioned in the readme did not work for me on a M1 Mac with Python 3.10. It seems some dependencies are omitted and the version on pip doesn't work.
This worked:
# dependencies
pip install cython numpy opencv-python opencv-contrib-python pdqhash
# install latest version from github instead pip
pip install git+https://github.com/thorn-oss/perception.git#egg=perception
Running:
> python
from perception import hashers;
hasher = hashers.PHash()
hasher.compute('image.jpg')
from perception.hashers.image.pdq import PDQHash;
hasher = PDQHash()
hasher.compute('image.jpg')
Installing using
pip install opencv-python perception
as mentioned in the readme did not work for me on a M1 Mac with Python 3.10. It seems some dependencies are omitted and the version on pip doesn't work.This worked:
Running: