项目作者: dries007

项目描述 :
Python bindings for the pHash (perceptual hashing) library.
高级语言: Python
项目地址: git://github.com/dries007/pHashPy.git
创建时间: 2020-02-02T13:50:08Z
项目社区:https://github.com/dries007/pHashPy

开源协议:GNU General Public License v3.0

下载


pHashPy

Python bindings for the pHash (perceptual hashing) library.

Copyright (c) Dries007 2020. \
Licensed under GPLv3 (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:

Testing build manually

Using CentOS 7 (with docker container quay.io/pypa/manylinux2014_x86_64):

  1. cd
  2. yum install -y cmake3 libpng-devel libjpeg-turbo-devel libsamplerate-devel libsndfile-devel libtiff-devel libvdpau-devel libvorbis-devel
  3. yum install -y epel-release
  4. rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
  5. rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
  6. yum install -y ffmpeg-devel
  7. git clone https://github.com/dries007/pHashPy.git
  8. cd pHashPy
  9. git submodule init
  10. git submodule update
  11. cd pHash
  12. echo "include_directories(/usr/include/ffmpeg)" >> CMakeLists.txt
  13. sed -i s/SHARED/STATIC/g CMakeLists.txt
  14. mkdir build
  15. cd build
  16. cmake3 .. -DCMAKE_BUILD_TYPE=Release -DWITH_VIDEO_HASH=1 -DWITH_AUDIO_HASH=1
  17. make -j