pdqhash 0.2.1
pip install pdqhash==0.2.1
Newer version available (0.2.8)
Released:
Python bindings for Facebook's PDQ hash
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT
- Author: Fausto Morales
Classifiers
- Development Status
- Operating System
- Programming Language
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)
# Get all the rotations and flips in one pass.
# hash_vectors is a list of vectors in the following order
# - Original
# - Rotated 90 degrees
# - Rotated 180 degrees
# - Rotated 270 degrees
# - Flipped vertically
# - Flipped horizontally
# - Rotated 90 degrees and flipped vertically
# - Rotated 90 degrees and flipped horizontally
hash_vectors, quality = pdqhash.compute_dihedral(image)
# Get the floating point values of the hash.
hash_vector_float, quality = pdqhash.compute_float(image)
Contributing
- Set up local development using
make init(you need to havepipenvinstalled) - Run tests using
make test - Run tests in Docker using
make docker_test
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT
- Author: Fausto Morales
Classifiers
- Development Status
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pdqhash-0.2.1.tar.gz.
File metadata
- Download URL: pdqhash-0.2.1.tar.gz
- Upload date:
- Size: 638.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d6e5426ffaf9ecd8244d22ff21c60b5c2a2b05935090c6e4f6f638cae4e455
|
|
| MD5 |
9fa2b2a5193ea904d814a65be765ee04
|
|
| BLAKE2b-256 |
4c84ac7e32e4be1a9f382233544848b58ee95e1103bcda8524e3eba8842fbe71
|