A package for image hashing
perception provides flexible, well-documented, and comprehensively tested tooling for perceptual hashing research, development, and production use. See the documentation for details.
pip install opencv-python perception
Hashing with different functions is simple with
from perception import hashers file1, file2 = 'test1.jpg', 'test2.jpg' hasher = hashers.PHash() hash1, hash2 = hasher.compute(file1), hasher.compute(file2) distance = hasher.compute_distance(hash1, hash2)
See below for end-to-end examples for common use cases for perceptual hashes.
Supported Hashing Algorithms
perception currently ships with:
- pHash (DCT hash) (
- Facebook's PDQ Hash (
- dHash (difference hash) (
- aHash (average hash) (
- Marr-Hildreth (
- Color Moment (
- Block Mean (
To work on the project, start by doing the following.
# Install local dependencies for # code completion, etc. make init # Build the Docker container to run # tests and such. make build
- You can get a JupyterLab server running to experiment with using
- To do a (close to) comprehensive check before committing code, you can use
- To view the documentation, use
To implement new features, please first file an issue proposing your change for discussion.
To report problems, please file an issue with sample code, expected results, actual results, and a complete traceback.
There are other packages worth checking out to see if they meet your needs for perceptual hashing. Here are some examples.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size perception-0.1.0.tar.gz (246.4 kB)||File type Source||Python version None||Upload date||Hashes View hashes|