MCPcopy Create free account
hub / github.com/albertpumarola/GANimation / detect_faces

Function detect_faces

utils/face_utils.py:8–19  ·  view source on GitHub ↗

Detect faces in image :param img: cv::mat HxWx3 RGB :return: yield 4

(img)

Source from the content-addressed store, hash-verified

6import warnings
7
8def 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 ''&#x27;
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
21def detect_biggest_face(img):
22 ''&#x27;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected