当前位置: 首页 > news >正文

百度网站建设哪家公司好腾讯建设网站视频视频

百度网站建设哪家公司好,腾讯建设网站视频视频,重庆网站建设changeke,技术支持 东莞网站建设 轴承本篇文章的代码块的实现主要是为了能够快速的通过python第三方非标准库对比出两张人脸是否一样。 实现过程比较简单#xff0c;但是第三方python依赖的安装过程较为曲折#xff0c;下面是通过实践对比总结出来的能够支持的几个版本#xff0c;避免大家踩坑。 python版本但是第三方python依赖的安装过程较为曲折下面是通过实践对比总结出来的能够支持的几个版本避免大家踩坑。 python版本3.6.8 dlib版本19.7.0 face-recognition版本0.1.10开始之前我们选择使用pip的方式对第三方的非标准库进行安装。 pip install cmakepip install dlib19.7.0pip install face-recognition0.1.10pip install opencv-python然后将使用到的模块cv2/face-recognition两个模块导入到代码块中即可。 # OpenCV is a library of programming functions mainly aimed at real-time computer vision. import cv2# Its loading a pre-trained model that can detect faces in images. import face_recognition新建一个python函数get_face_encodings用来获取人脸部分的编码后面可以根据这个编码来进行人脸比对。 def get_face_encodings(image_path):It takes an image path, loads the image, finds the faces in the image, and returns the 128-d face encodings for eachface:param image_path: The path to the image to be processed# Its loading a pre-trained model that can detect faces in images.image cv2.imread(image_path)# Its converting the image from BGR to RGB.image_RGB image[:, :, ::-1]image_face face_recognition.face_locations(image_RGB)# Its taking the image and the face locations and returning the face encodings.face_env face_recognition.face_encodings(image_RGB, image_face)# Its returning the first face encoding in the list.return face_env[0]上述函数中注释都是通过Pycharm插件自动生成的接下来我们直接调用get_face_encodings函数分别获取两个人脸的编码。 # Its taking the image and the face locations and returning the face encodings. ima1 get_face_encodings(03.jpg)# Its taking the image and the face locations and returning the face encodings. ima2 get_face_encodings(05.jpg)上面我们选择了两张附有人脸的图片并且已经获取到了对应的人脸编码。接着使用compare_faces函数进行人脸比对。 # Its comparing the two face encodings and returning True if they match. is_same face_recognition.compare_faces([ima1], ima2, tolerance0.3)[0]print(人脸比对结果{}.format(is_same))人脸比对结果False 这个时候人脸比对结果已经出来了False代表不一样。这里compare_faces有一个比较重要的参数就是tolerance0.3默认情况下是0.6。 tolerance参数的值越小的时候代表比对要求更加严格因此这个参数的大小需要根据实际情况设置它会直接影响整个比对过程的结果。 往期精彩 python自制PDF转换.PNG格式图片按每页生成图片完整源码小工具 python如何使用最简单的方式将PDF转换成Word python项目环境迁移时如何生成第三方库文件requirements.txt并安装
http://www.w-s-a.com/news/55783/

相关文章:

  • 珠海网站设计建建建设网站公司网站
  • 广州高端网站制作公司哪家好网页制作公司 软件
  • 最快做网站的语言百度站长反馈
  • 简单网站设计价格手机网站技巧
  • 什么颜色做网站显的大气网站建设的含盖哪方面
  • 没网站怎么做二维码扫描连接济南做网站推广哪家好
  • 台州建设规划局网站搞外贸一般是干什么的
  • 怎么提高自己网站的知名度电子商务是建网站
  • 官方查企业的网站办公用品网站建设策划书
  • 微信网站搭建哪家好网站中转页
  • 阿里巴巴网站开发是谁长沙自助模板建站
  • 阿里云网站方案建设书网络公司运营是干啥的
  • 南通seo网站排名优化nginx wordpress rewrite
  • 网站做成软件做内部网站费用
  • 浙江企业网站建设网站域名有了 网站如何建设
  • 学编程哪个机构有权威德州做网站优化
  • 最火的网站开发语言福州网站建设服务商
  • 嘉兴网站制作哪里好asp网站源码免费版
  • 如何给网站配置域名百度网站统计添加网址
  • 搭建wap网站磁力引擎
  • 如何给公司网站做推广个人网站可以做社区吗
  • 网站建设为什么不给源代码大理如何做百度的网站
  • 网站代理违法吗网站备份流程
  • 免费域名查询网站wordpress wordfence
  • h5响应式网站模板制作巴南网站制作
  • 网站方案报价软文什么意思
  • 电子商城网站如何建设上海公司车牌价格
  • 丽江网站设计公司专业公司网站设计企业
  • iis怎么建设网站特色产品推广方案
  • 道路建设网站专题品牌网站建设特色大蝌蚪