当前位置:网站首页>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)
原图:
检测后的图:
边栏推荐
- nRF52832自定義服務與特性
- 三年磨一剑:蚂蚁金服的研发效能洞察实践
- Leetcode dynamic programming
- EBook editing and deleting
- Jackson - how to convert the array string with only one map object to list < map >
- Execute sh script to prompt "[[: not found" solution. The difference between Bash and sh
- 软件项目架构简单总结
- What is the lszrz protocol used at ordinary times? Talk about xmodem/ymodem/zmodem
- Understanding of distributed transactions
- EBook upload
猜你喜欢

Halcon 3D 1 Reading 3D data

Performance optimization metrics and tools
![How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]](/img/65/a214d137e230b1a1190feb03660f2c.jpg)
How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]

Rtmp/rtsp/hls public network real available test address

TCP and UDP introduction

Redis memory obsolescence strategy

Leetcode simple problem: converting an integer to the sum of two zero free integers

为什么联合索引是最左匹配原则?

Project and build Publishing

Redis persistence
随机推荐
RTMP streaming +rtmp playback low delay solution in unity environment
Directx11 advanced tutorial tiled based deffered shading
Glossary of Chinese and English terms for pressure sensors
Leetcode-717. 1-bit and 2-bit characters (O (1) solution)
nus_ data_ Handler source code interprets data types such as structure
XML parameter schema, the same MTK SW version is compatible with two different sets of audio parameters
Who is more fierce in network acceleration? New king reappeared in CDN field
Unity VSCode不能跳转到定义
Available RTMP and RTSP test addresses of the public network (updated in March, 2021)
[untitled]
Json-c common APIs
TCP and UDP introduction
Une explication du 80e match bihebdomadaire de leetcode
Heap classical problem
Leetcode sword finger offer II 033 Modified phrase
Research Report on water sports shoes industry - market status analysis and development prospect forecast
MySQL 主从,6 分钟带你掌握
Directx11 advanced tutorial cluster based deffered shading
nus_data_handler源码解读结构体等数据类型
EBook list page