MCPcopy
hub / github.com/ageitgey/face_recognition / _raw_face_locations

Function _raw_face_locations

face_recognition/api.py:89–102  ·  view source on GitHub ↗

Returns an array of bounding boxes of human faces in a image :param img: An image (as a numpy array) :param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces. :param model: Which face detection model to use. "hog"

(img, number_of_times_to_upsample=1, model="hog")

Source from the content-addressed store, hash-verified

87
88
89def _raw_face_locations(img, number_of_times_to_upsample=1, model="hog"):
90 """
91 Returns an array of bounding boxes of human faces in a image
92
93 :param img: An image (as a numpy array)
94 :param number_of_times_to_upsample: How many times to upsample the image looking for faces. Higher numbers find smaller faces.
95 :param model: Which face detection model to use. "hog" is less accurate but faster on CPUs. "cnn" is a more accurate
96 deep-learning model which is GPU/CUDA accelerated (if available). The default is "hog".
97 :return: A list of dlib 'rect' objects of found face locations
98 """
99 if model == "cnn":
100 return cnn_face_detector(img, number_of_times_to_upsample)
101 else:
102 return face_detector(img, number_of_times_to_upsample)
103
104
105def face_locations(img, number_of_times_to_upsample=1, model="hog"):

Callers 2

face_locationsFunction · 0.85
_raw_face_landmarksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected