thorn-oss / perception

Perceptual hashing tools for detecting child sexual abuse material

Home Page:https://perception.thorn.engineering/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PQD hash not integrated

kpatsakis opened this issue · comments

Hi there,

It looks like PQD hash has not been integrated yet in the code

Hi there! To use PDQ with perception, please do pip install pdqhash perception. Then you can do:

import perception.hashers.image.pdq as pdq

hasher = pdq.PDQHash()
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF.jpg/1024px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF.jpg"
hasher.compute(url) # zGOKbNjmSxkBvTyjOPNhyucZ7DmC5r7thkyKJ5t3QRY=

The reason you have to install pdqhash separately is that it builds from the ThreatExchange source during the installation, which requires users to have a working build configuration. And so the bindings for Python are implemented in pdqhash and then used by perception if that package is installed.

Hi @kpatsakis. Closing this issue but please feel free to re-open if you still have problems.