当前位置:网站首页>Face_ Recognition face detection
Face_ Recognition face detection
2022-04-23 07:22:00 【Lin Jinpeng】
List of articles
principle
face_recognition It is the simplest face recognition database , The accuracy of the model is 99.38%
The code only needs three lines :
import face_recognition
image = face_recognition.load_image_file("your_file.jpg")
face_locations = face_recognition.face_locations(image)
One 、 Results the preview


face_locations Return the coordinate positions of all faces in the picture , coordination cv2 The library draws all the coordinates on the picture .
Two 、 Implementation process
import face_recognition
import cv2
# Loading pictures
image = face_recognition.load_image_file("1.jpg")
# Recognize the position of all faces in the picture
face_locations = face_recognition.face_locations(image)
img = cv2.imread("1.jpg", cv2.IMREAD_COLOR)
for i in face_locations:
#face_locations Return parameter position description (top, right, bottom, left)
top = i[0]
right = i[1]
bottom = i[2]
left = i[3]
# param 1: picture
# param 2: Top left coordinates
# param 3: Lower right coordinates
# param Box color
# Box size
cv2.rectangle(img, (left, top), (right, bottom), (255, 255, 255), 2)
# display picture
cv2.imshow("1.jpg", img)
# Save as new file
cv2.imwrite("new.jpg", img)
cv2.waitKey(0)
cv2.destroyAllWindows()

版权声明
本文为[Lin Jinpeng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230609473033.html
边栏推荐
- 去掉状态栏
- 【点云系列】点云隐式表达相关论文概要
- xcode 编译速度慢的解决办法
- Viewpager2 realizes Gallery effect. After notifydatasetchanged, pagetransformer displays abnormal interface deformation
- 【点云系列】SO-Net:Self-Organizing Network for Point Cloud Analysis
- [dynamic programming] Yang Hui triangle
- Thanos.sh灭霸脚本,轻松随机删除系统一半的文件
- 【指标】Precision、Recall
- winform滚动条美化
- 常见的正则表达式
猜你喜欢

【点云系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation

Bottom navigation bar based on bottomnavigationview

face_recognition人脸检测

PyMySQL连接数据库

【2021年新书推荐】Effortless App Development with Oracle Visual Builder

第2章 Pytorch基础2

Visual studio 2019 installation and use

【2021年新书推荐】Practical IoT Hacking

C language, a number guessing game

Record WebView shows another empty pit
随机推荐
ArcGIS License Server Administrator 无法启动解决方法
adb shell常用模拟按键keycode
Data class of kotlin journey
Gephi教程【1】安装
Binder mechanism principle
利用官方torch版GCN训练并测试cora数据集
【點雲系列】SG-GAN: Adversarial Self-Attention GCN for Point Cloud Topological Parts Generation
[Point Cloud Series] SG - Gan: Adversarial Self - attachment GCN for Point Cloud Topological parts Generation
第8章 生成式深度学习
MySQL notes 5_ Operation data
【点云系列】Learning Representations and Generative Models for 3D pointclouds
MySQL notes 1_ database
如何对多维矩阵进行标准化(基于numpy)
[2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide
Pymysql connection database
Visual studio 2019 installation and use
常见的正则表达式
[recommendation of new books in 2021] enterprise application development with C 9 and NET 5
Minesweeping games
[2021 book recommendation] red hat rhcsa 8 cert Guide: ex200