当前位置:网站首页>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
边栏推荐
- About JMeter startup flash back
- Passing header request header information between services through feign
- 04 Lua operator
- Oak-d raspberry pie cloud project [with detailed code]
- Force buckle-746 Climb stairs with minimum cost
- Day (2) of picking up matlab
- Solution of garbled code on idea console
- Take according to the actual situation, classify and summarize once every three levels, and see the figure to know the demand
- Gartner publie une étude sur les nouvelles technologies: un aperçu du métacosme
- Day (3) of picking up matlab
猜你喜欢

Questions about disaster recovery? Click here

Meaning and usage of volatile

Solution of garbled code on idea console

Matplotlib tutorial 05 --- operating images

Install MySQL on MAC

文件操作详解(2)

RAID磁盘阵列与RAID5的创建

Construction of esp32 compilation environment

The system research problem that has plagued for many years has automatic collection tools, which are open source and free

On the security of key passing and digital signature
随机推荐
Creation of RAID disk array and RAID5
文件系统读写性能测试实战
Gartner predicts that the scale of cloud migration will increase significantly; What are the advantages of cloud migration?
MySQL的btree索引和hash索引区别
Change the icon size of PLSQL toolbar
Server log analysis tool (identify, extract, merge, and count exception information)
Countdown 1 day ~ 2022 online conference of cloud disaster tolerance products is about to begin
Custom implementation of Baidu image recognition (instead of aipocr)
文件操作详解(2)
The most detailed Backpack issues!!!
最詳細的背包問題!!!
How to upgrade openstack across versions
Start Oracle service on Linux
How to quickly batch create text documents?
homwbrew安装、常用命令以及安装路径
Gartner 发布新兴技术研究:深入洞悉元宇宙
The most detailed knapsack problem!!!
Passing header request header information between services through feign
Using JSON server to create server requests locally
Flask如何在内存中缓存数据?