thorn-oss / perception

Perceptual hashing tools for detecting child sexual abuse material
https://perception.thorn.engineering/
Apache License 2.0
173 stars 16 forks source link

Installation instructions not working #27

Closed alexkli closed 3 days ago

alexkli commented 1 year ago

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')
mjs2600 commented 3 days ago

@alexkli this should be working now.