"Python绑定Facebook的PDQ哈希"
项目描述
pdqhash-python
这是Facebook发布的PDQ感知哈希的Python绑定。请注意,绑定在MIT许可下提供,但PDQ源代码在其自己的许可下分别许可(见ThreatExchange/hashing/pdq
文件夹)。
安装
pip install pdqhash
使用
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)
贡献
- 使用
make init
设置本地开发(您需要已安装pipenv
) - 使用
make test
运行测试 - 使用
make docker_test
在Docker中运行测试
项目详情
下载文件
下载适合您平台文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。
源分发
pdqhash-0.2.5.tar.gz (666.5 kB 查看哈希值)
构建分发
pdqhash-0.2.5-cp310-cp310-win_amd64.whl (45.8 kB 查看哈希值)
pdqhash-0.2.5-cp39-cp39-win_amd64.whl (54.3 kB 查看哈希)
pdqhash-0.2.5-cp38-cp38-win_amd64.whl (54.6 kB 查看哈希)
pdqhash-0.2.5-cp37-cp37m-win_amd64.whl (54.0 kB 查看哈希)
关闭
pdqhash-0.2.5.tar.gz 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c688f3f6ea65debb6213577f46ba2be9ebb7db7d23f96ad6ed2df05832de93c3 |
|
MD5 | d142d5aedf4a4b26bc0de703899f1c43 |
|
BLAKE2b-256 | 98c129cd086b7f7472771fb4b207ed857aae71dc183b88f1f3471ec888faa911 |
关闭
pdqhash-0.2.5-cp310-cp310-win_amd64.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 211431c347e737ff247a39fb24924c93c853d793842961cf476d40fa9a586eca |
|
MD5 | c10954ee2e033ea3786b564ab4f7eb07 |
|
BLAKE2b-256 | 58775af0672350aa0850938516f3fa7aab8e7160bd61fa43fad5e317b0cc301d |
关闭
pdqhash-0.2.5-cp310-cp310-macosx_11_0_x86_64.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1b3d4a6251033d8bfbb8d054fcdbcd0ea6b7a93c6a0b7433c9947c4fb4a3f5ef |
|
MD5 | 3f616f799b8aa59945eedcb535391a27 |
|
BLAKE2b-256 | 4818609052b1e0cb18007cc806b29b699ba84524366d272419e0db91786b6504 |
关闭
pdqhash-0.2.5-cp39-cp39-win_amd64.whl 的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2b0519a07551a753380cf76db24212b4db7c0ea30516b620a5c902d25b467e6a |
|
MD5 | 7011421c551822364b4b3e3aa1055d8b |
|
BLAKE2b-256 | 591bb2c25b2cdba512f1a77e1dc7d002f21e50ce487cebb06e543b8a9c5e619f |
关闭
哈希值 用于 pdqhash-0.2.5-cp39-cp39-macosx_11_0_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a2daed23628cf58eb866bcef9731de6c159578e32e939a71939e0d8032b11a86 |
|
MD5 | 567ba85f6f6c63235eb1f2c134dab9fb |
|
BLAKE2b-256 | d0eb8dc19ba38dd0b4bd7f1235cb8e3e1a82cbab004a6b2a37b9b2e4a1283731 |
关闭
哈希值 用于 pdqhash-0.2.5-cp38-cp38-macosx_11_0_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 230694fab7b7f70fc494ee8bc3a0a5960ed82c4a78421a357e1312d933947854 |
|
MD5 | 67a0d9739b2129a0510ecb8e54c52b45 |
|
BLAKE2b-256 | 4466485eca50c907d4b515127f54bcbe323f3bfc13324d098729906f6cb4f1ae |
关闭
哈希值 用于 pdqhash-0.2.5-cp37-cp37m-macosx_11_0_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 70a905a777826293ab5e4eba0e05e8c44467d873959d336a0558d0f632a90133 |
|
MD5 | 3ccbd753f984aba6dca32f72f3596ca8 |
|
BLAKE2b-256 | ce19939fed7b0ef426ef31d20995d4ffa45a6ac6f184a3579f612c9ce8a48a70 |