Skip to main content

Python bindings for Facebook's PDQ hash

Project description

pdqhash-python

These are Python bindings to the PDQ perceptual hash released by Facebook. Note that the bindings are provided under the MIT license but the PDQ source code is licensed separately under its own license (see the ThreatExchange/hashing/pdq folder).

Installation

pip install pdqhash

Usage

import pdqhash

image = cv2.imread(os.path.join('tests', 'images', image_name))
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
hash_vector, quality = pdqhash.compute(image)

Contributing

  • Set up local development using make init (you need to have pipenv installed)
  • Run tests using make test
  • Run tests in Docker using make docker_test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdqhash-0.1.4.tar.gz (636.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page