facebook pdq散列的python绑定

pdqhash的Python项目详细描述


pdqhash python

这些是facebook发布的pdq感知散列的python绑定。请注意,绑定是在mit许可证下提供的,但是pdq源代码是在其自己的许可证下单独许可的(请参见ThreatExchange/hashing/pdq文件夹)。

安装

pip install pdqhash

用法

importpdqhashimage=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 horizontallyhash_vectors,quality=pdqhash.compute_dihedral(image)

贡献

  • 使用make init设置本地开发(您需要安装pipenv
  • 使用make test
  • 运行测试
  • 在Docker中使用make docker_test
  • 运行测试

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JPA。Eclipselink没有为mySQL提供密码,但它应该提供   我的Servlet和@FormDataParam存在java问题   java将什么作为上下文参数传递到文件I/O方法中?   如果两个值相同,java无法找到其中一个单选按钮   java在变量和方法名中使用下划线   JavaSpringMVC单线程安全?   klazz类的java Arraylist(反射Api)   java如何在数字字符串中查找最频繁的数字?   JavaAPI设计:使数据更易于阅读与强制更多API调用   JavaHadoopMapReduceforGoogleWebGraph   java无法启动gauge API:Runner意外退出   java如何在bluemix上使用ibm工作负载调度器?   拉取一年中某一周特定日期的所有日期   java为什么是我的角节点。js应用程序将图像上传到S3� 邮递员正确上传时的符号?   在不使用任何第三方jar的情况下将文件从本地传输到linux系统(java代码)   java将现有文件夹复制到Eclipse工作区中新创建的项目中   Java中的regex RegExp帮助   当使用“系统”外观时,Java组合框setSelectedItem会出现故障   JavaASM:在类的方法中获取局部变量名和值