Detect faces in image :param img: cv::mat HxWx3 RGB :return: yield 4
(img)
| 6 | import warnings |
| 7 | |
| 8 | def detect_faces(img): |
| 9 | ''' |
| 10 | Detect faces in image |
| 11 | :param img: cv::mat HxWx3 RGB |
| 12 | :return: yield 4 <x,y,w,h> |
| 13 | ''' |
| 14 | # detect faces |
| 15 | bbs = face_recognition.face_locations(img) |
| 16 | |
| 17 | for y, right, bottom, x in bbs: |
| 18 | # Scale back up face bb |
| 19 | yield x, y, (right - x), (bottom - y) |
| 20 | |
| 21 | def detect_biggest_face(img): |
| 22 | ''' |
nothing calls this directly
no outgoing calls
no test coverage detected