当前位置:网站首页>Dlib of face recognition framework
Dlib of face recognition framework
2022-04-23 16:35:00 【Andrew p】
1. Face detection is as follows
import dlib
from imageio import imread
detector = dlib.get_frontal_face_detector()# detector
predictor_path = 'shape_predictor_68_face_landmarks.dat'
predictor = dlib.shape_predictor(predictor_path)# predictor
win = dlib.image_window()
path ='111.jpg'
img = imread(path)
win.clear_overlay()
win.set_image(img)
# 1 It means to double the size of the picture , Easy to detect more faces
dets = detector(img, 1)
print(' Detected. %d Personal face ' % len(dets))
for i, d in enumerate(dets):
print('- %d: Left %d Top %d Right %d Bottom %d' % (i, d.left(), d.top(), d.right(), d.bottom()))
shape = predictor(img, d)
# The first 0 Point and number 1 Coordinates of points
print('Part 0: {}, Part 1: {}'.format(shape.part(0), shape.part(1)))
win.add_overlay(shape)
2. Generate face detector
detector = dlib.get_frontal_face_detector()# detector
3. Generate feature predictor ,68 Dimensional
predictor_path = 'shape_predictor_68_face_landmarks.dat'
predictor = dlib.shape_predictor(predictor_path)# predictor
shape_predictor(landmark_model_path)
Parameters :landmark_model_path:68 features landmarks Model path
The official example is as follows :
http://dlib.net/face_alignment.py.html
# Load all the models we need: a detector to find the faces, a shape predictor
# to find face landmarks so we can precisely localize the face
Load all the models we need : A detector for finding faces , A shape predictor for finding face signs , So we can accurately locate the face
4. Start detection
# 1 It means to double the size of the picture , Easy to detect more faces
dets = detector(img, 1)
5. return 68 Characteristic points
shape = predictor(img, d)
6. Draw feature points on the original graph
for i, d in enumerate(dets):
print('- %d: Left %d Top %d Right %d Bottom %d' % (i, d.left(), d.top(), d.right(), d.bottom()))
shape = predictor(img, d)
# The first 0 Point and number 1 Coordinates of points
print('Part 0: {}, Part 1: {}'.format(shape.part(0), shape.part(1)))
win.add_overlay(shape)
result
版权声明
本文为[Andrew p]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231624569457.html
边栏推荐
- Hyperbdr cloud disaster recovery v3 Version 2.1 release supports more cloud platforms and adds monitoring and alarm functions
- What is the experience of using prophet, an open source research tool?
- Download and install mongodb
- 磁盘管理与文件系统
- Force buckle - 198 raid homes and plunder houses
- Jour (9) de ramassage de MATLAB
- Oracle data pump usage
- Detailed explanation of gzip and gunzip decompression parameters
- Day (10) of picking up matlab
- Questions about disaster recovery? Click here
猜你喜欢
第十天 异常机制
451. 根据字符出现频率排序
Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
TIA botu - basic operation
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
Set the color change of interlaced lines in cells in the sail software and the font becomes larger and red when the number is greater than 100
OMNeT学习之新建工程
Download and install mongodb
Hypermotion cloud migration helped China Unicom. Qingyun completed the cloud project of a central enterprise and accelerated the cloud process of the group's core business system
Sail soft implements a radio button, which can uniformly set the selection status of other radio buttons
随机推荐
Summary according to classification in sail software
5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
VIM uses vundle to install the code completion plug-in (youcompleteme)
Server log analysis tool (identify, extract, merge, and count exception information)
第九天 static 抽象类 接口
ESXi封装网卡驱动
Hypermotion cloud migration helped China Unicom. Qingyun completed the cloud project of a central enterprise and accelerated the cloud process of the group's core business system
File system read and write performance test practice
Oak-d raspberry pie cloud project [with detailed code]
Real time operation of vim editor
[key points of final review of modern electronic assembly]
On the security of key passing and digital signature
Day (5) of picking up matlab
TIA botu - basic operation
Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
299. Number guessing game
Install MySQL on MAC
各大框架都在使用的Unsafe类,到底有多神奇?
Vim使用Vundle安装代码补全插件(YouCompleteMe)
Introduction notes to PHP zero Foundation (13): array related functions