当前位置:网站首页>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
边栏推荐
- On the value, breaking and harvest of NFT project
- Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
- Install redis and deploy redis high availability cluster
- [key points of final review of modern electronic assembly]
- vim编辑器的实时操作
- Best practice of cloud migration in education industry: Haiyun Jiexun uses hypermotion cloud migration products to implement progressive migration for a university in Beijing, with a success rate of 1
- 451. 根据字符出现频率排序
- 299. 猜数字游戏
- Day (8) of picking up matlab
- What is the experience of using prophet, an open source research tool?
猜你喜欢
Query the data from 2013 to 2021, and only query the data from 2020. The solution to this problem is carried out
Homewbrew installation, common commands and installation path
451. 根据字符出现频率排序
Use itextpdf to intercept the page to page of PDF document and divide it into pieces
欣旺达:HEV和BEV超快充拳头产品大规模出货
[key points of final review of modern electronic assembly]
Real time operation of vim editor
Gartner announces emerging technology research: insight into the meta universe
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
100 deep learning cases | day 41 - convolutional neural network (CNN): urbansound 8K audio classification (speech recognition)
随机推荐
The most detailed knapsack problem!!!
Oracle data pump usage
There is a problem with the light switch from 1 to 100
面试题 17.10. 主要元素
欣旺达:HEV和BEV超快充拳头产品大规模出货
JSP learning 2
04 Lua operator
G008-hwy-cc-estor-04 Huawei Dorado V6 storage simulator configuration
On the value, breaking and harvest of NFT project
Gartner 發布新興技術研究:深入洞悉元宇宙
力扣-198.打家劫舍
JMeter setting environment variable supports direct startup by entering JMeter in any terminal directory
Use if else to judge in sail software - use the title condition to judge
第十天 异常机制
Detailed explanation of UWA pipeline function | visual configuration automatic test
Day (3) of picking up matlab
The font of the soft cell changes color
Postman batch production body information (realize batch modification of data)
磁盘管理与文件系统
JSP learning 3