Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dries007/phashpy
Python bindings for the pHash (perceptual hashing) library.
https://github.com/dries007/phashpy
cppyy phash python python3
Last synced: about 2 months ago
JSON representation
Python bindings for the pHash (perceptual hashing) library.
- Host: GitHub
- URL: https://github.com/dries007/phashpy
- Owner: dries007
- License: gpl-3.0
- Created: 2020-02-02T13:50:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T19:22:24.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T12:54:18.430Z (2 months ago)
- Topics: cppyy, phash, python, python3
- Language: Python
- Homepage: https://pypi.org/project/pHashPy/
- Size: 53.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
# pHashPy
**Python bindings for the [pHash](https://github.com/aetilius/pHash) (perceptual hashing) library.**
Copyright (c) Dries007 2020. \
Licensed under [GPLv3](COPYING) (or later), as is pHash itself.The project uses cppyy to create a small wrapper around pHash functions.
## Features
Working:
- Video hashing
- Image hashing (dct & mh)Missing:
- Audio
- Text## Usage
### As a Command Line Tool
You can use the tool as a command line utility to generate a list of hashes from a list of files.
Run `python -m pHashPy --help` for more info.
### As a Library
Import functions from the package's `__init__`, this will automatically load the required library files.
If you import the functions from the individual py files, you must call `helper.init` yourself.## Background Info
For more info on pHash:
- https://github.com/aetilius/pHash
- https://www.phash.org/
- https://www.phash.org/docs/design.html (Theory.)
- https://www.phash.org/docs/howto.html (Help for developers, archived as [DevelopmentGuide.md](./DevelopmentGuide.md).)## Testing build manually
Using CentOS 7 (with docker container `quay.io/pypa/manylinux2014_x86_64`):
```bash
cdyum install -y cmake3 libpng-devel libjpeg-turbo-devel libsamplerate-devel libsndfile-devel libtiff-devel libvdpau-devel libvorbis-devel
yum install -y epel-releaserpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install -y ffmpeg-develgit clone https://github.com/dries007/pHashPy.git
cd pHashPy
git submodule init
git submodule updatecd pHash
echo "include_directories(/usr/include/ffmpeg)" >> CMakeLists.txt
sed -i s/SHARED/STATIC/g CMakeLists.txtmkdir build
cd build
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DWITH_VIDEO_HASH=1 -DWITH_AUDIO_HASH=1
make -j
```