当前位置:网站首页>Dlib face detection
Dlib face detection
2022-06-12 06:08:00 【Just change your name】
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)]] A person
# 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)
Original picture :
Diagram after detection :
边栏推荐
- Analysis of memory management mechanism of (UE4 4.26) UE4 uobject
- Quickly master makefile file writing
- 为什么数据库不使用二叉树、红黑树、B树、Hash表? 而是使用了B+树
- Database experiment I: data definition experiment guide
- Jackson - how to convert the array string with only one map object to list < map >
- sqlite交叉编译动态库
- R语言大作业(四):上海市、东京 1997-2018 年GDP值分析
- Bert use
- Leetcode 第 80 场双周赛题解
- About why GPU early-z reduces overdraw
猜你喜欢
随机推荐
Project technical structure
E-book analysis
C # converts the hexadecimal code form of text to text (ASCII)
Unity implements smooth interpolation
EBook upload
Three years of sharpening a sword: insight into the R & D efficiency of ant financial services
Recursive implementation of exponential, permutation and combination enumerations
Nrf52832 -- official routine ble_ app_ UART adds the LED feature to enable the computer UART and mobile app to control the LED on and off of the development board
n次贝塞尔曲线
Glossary of Chinese and English terms for pressure sensors
Unity custom translucent surface material shader
How do I get the date and time from the Internet- How to get DateTime from the internet?
Leetcode sword finger offer II 119 Longest continuous sequence
Leetcode-1706. Where does the club fall
Why do I object so [1.01 to the power of 365 and 0.99 to the power of 365]
The application could not be installed: INSTALL_ FAILED_ TEST_ ONLY
Analysis of memory management mechanism of (UE4 4.26) UE4 uobject
MySQL master-slave, 6 minutes to master
MNIST handwritten data recognition by RNN
Research Report on truffle fungus industry - market status analysis and development prospect forecast






![User login [next]](/img/e1/c3429f0b2bf06e3f7d87e32ca153b6.jpg)


