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 details)

Uploaded Source

File details

Details for the file pdqhash-0.1.4.tar.gz.

File metadata

  • Download URL: pdqhash-0.1.4.tar.gz
  • Upload date:
  • Size: 636.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for pdqhash-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a3f191e79702192052ff24c36b8c43dbd96140e65a571d573e6284cb9c25175f
MD5 c11cf0c1c88950c91369de006479170f
BLAKE2b-256 72d608d3b6e274ed701926f61b518b052041d697831cffe5be30906e27841094

See more details on using hashes here.

Supported by

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