当前位置:网站首页>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
边栏推荐
- Machine learning II: logistic regression classification based on Iris data set
- [2021 book recommendation] artistic intelligence for IOT Cookbook
- [dynamic programming] triangle minimum path sum
- 第3章 Pytorch神经网络工具箱
- [2021 book recommendation] Red Hat Certified Engineer (RHCE) Study Guide
- Minesweeping games
- 第2章 Pytorch基础2
- ProcessBuilder工具类
- 最简单完整的libwebsockets的例子
- Pytorch模型保存与加载(示例)
猜你喜欢
ArcGIS License Server Administrator 无法启动解决方法
【点云系列】点云隐式表达相关论文概要
Gephi tutorial [1] installation
机器学习 三: 基于逻辑回归的分类预测
【2021年新书推荐】Red Hat RHCSA 8 Cert Guide: EX200
[point cloud series] a rotation invariant framework for deep point cloud analysis
【点云系列】FoldingNet:Point Cloud Auto encoder via Deep Grid Deformation
【点云系列】 A Rotation-Invariant Framework for Deep Point Cloud Analysis
Component learning (2) arouter principle learning
Easyui combobox 判断输入项是否存在于下拉列表中
随机推荐
Some common data type conversion methods in pytorch are similar to list and NP Conversion method of ndarray
【点云系列】Pointfilter: Point Cloud Filtering via Encoder-Decoder Modeling
【动态规划】不同路径2
【动态规划】不同的二叉搜索树
Mysql database installation and configuration details
Three methods to realize the rotation of ImageView with its own center as the origin
5种方法获取Torch网络模型参数量计算量等信息
【指标】Precision、Recall
Summary of image classification white box anti attack technology
【2021年新书推荐】Red Hat RHCSA 8 Cert Guide: EX200
【点云系列】Learning Representations and Generative Models for 3D pointclouds
Visual Studio 2019安装与使用
Pytorch model pruning example tutorial III. multi parameter and global pruning
C language, a number guessing game
Pymysql connection database
[2021 book recommendation] effortless app development with Oracle visual builder
[dynamic programming] Yang Hui triangle
【3D形状重建系列】Implicit Functions in Feature Space for 3D Shape Reconstruction and Completion
DCMTK(DCM4CHE)与DICOOGLE协同工作
ArcGIS License Server Administrator 无法启动解决方法