MMOD Model Documentation
Documentation for Max-Margin Object Detection (MMOD) models.
Read more about this detection method in the dlib MMOD documentation here.
detect_face_mmod(img, detector, in_height=300, in_width=0, detect_multiple_faces=False)
Detects faces in an image using the CNN-based dlib MMOD (Max-Margin Object Detection) face detector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
ndarray
|
The input image in which faces are to be detected. The image should be in a format
acceptable by OpenCV, typically a numpy ndarray obtained from |
required |
detector |
fhog_object_detector
|
The dlib MMOD face detector object, which can be initialized with
|
required |
in_height |
int
|
The height to which the image will be resized for detection, maintaining the aspect ratio. Default is 300 pixels. |
300
|
in_width |
int
|
The width to which the image will be resized for detection. If set to 0, it will be calculated based on the aspect ratio of the input image. Defaults to 0. |
0
|
detect_multiple_faces |
bool
|
Specifies whether to detect and return bounding boxes for all faces found in the image or just the most prominent face. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
list | tuple | None
|
If |
Source code in src/models/code/mmod.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|