当前位置:网站首页>dlib 人脸检测
dlib 人脸检测
2022-06-12 06:03:00 【换个名字就很好】
import dlib
import cv2
pth = r"0001_01.jpg"
pth2 = r"OIP-C.jpg"
img = dlib.load_rgb_image(pth2)
detector = dlib.get_frontal_face_detector()
dets = detector(img, 1)
print(dets) # pth: rectangles[[(171, 201) (438, 468)]] 一个人
# pth2: rectangles[[(17, 18) (53, 54)], [(53, 18) (89, 54)], [(177, 38) (213, 74)], [(217, 34) (253, 70)]] four people
print(type(dets))
img2 = cv2.imread(pth2)
# image_for_nms_box = cv2.rectangle(image_for_nms_box, (x1, y1), (x2, y2), (0,255,0), 2)
# img2 = cv2.rectangle()
print(len(dets))
for d in dets:
x1, y1 = d.left(), d.top()
x2, y2 = d.right(), d.bottom()
img2 = cv2.rectangle(img2, (x1, y1), (x2, y2), (0,255,0), 2)
cv2.imwrite("OIP-C_boxes.jpg", img2)
原图:
检测后的图:
边栏推荐
- Project technical structure
- Unable to access this account. You may need to update your password or grant the account permission to synchronize to this device. Tencent corporate email
- 为什么联合索引是最左匹配原则?
- POI, easyexcel framework use
- [gpio] how to modify / display GPIO status through ADB shell
- Execute sh script to prompt "[[: not found" solution. The difference between Bash and sh
- User login 【 I 】
- Leetcode-1706. Where does the club fall
- Database Experiment 3: data query
- EBook list page
猜你喜欢

March 23, 2021

Leetcode-1260. 2D mesh migration
![Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]](/img/25/b3c475e2b03c39b7c576b6d01f9d56.jpg)
Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]

Lock and reentrankload

Es6-es11 learning

网络加速谁更猛?CDN领域再现新王者

Directx11 advanced tutorial cluster based deffered shading

March 22, 2021

EBook list page

Chapter 8 - structure
随机推荐
March 23, 2021
Halcon uses points to fit a plane
Brief introduction to project development process
数据集成框架SeaTunnel学习笔记
Une explication du 80e match bihebdomadaire de leetcode
Filter的注解配置
Leetcode-2048. Next larger numerical balance
sqlite交叉编译动态库
Redis persistence
网络加速谁更猛?CDN领域再现新王者
C WMI query remote Win32_ Operatingsystem class
How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]
三年磨一剑:蚂蚁金服的研发效能洞察实践
Divide a folder image into training set and test set
Leetcode 第 80 場雙周賽題解
BlockingQueue interface introduction
E-book analysis
The application could not be installed: INSTALL_ FAILED_ TEST_ ONLY
软件项目架构简单总结
What is the lszrz protocol used at ordinary times? Talk about xmodem/ymodem/zmodem