model.yolo_faceο
Description
π² Fast face detection model that can distinguish between masked and unmasked faces.
- class Node(config=None, **kwargs)[source]ο
Initializes and uses the YOLO face detection model to infer bboxes from image frame.
The YOLO face model is a two class model capable of differentiating human faces with and without face masks.
- Inputs
img
(numpy.ndarray
): A NumPy array of shape \((height, width, channels)\) containing the image data in BGR format.- Outputs
bboxes
(numpy.ndarray
): A NumPy array of shape \((N, 4)\) containing normalized bounding box coordinates of \(N\) detected objects. Each bounding box is represented as \((x_1, y_1, x_2, y_2)\) where \((x_1, y_1)\) is the top-left corner and \((x_2, y_2)\) is the bottom-right corner. The order corresponds to bbox_labels and bbox_scores.bbox_labels
(numpy.ndarray
): A NumPy array of shape \((N)\) containing strings representing the labels of detected objects. The order corresponds to bboxes and bbox_scores.bbox_scores
(numpy.ndarray
): A NumPy array of shape \((N)\) containing confidence scores \([0, 1]\) of detected objects. The order corresponds to bboxes and bbox_labels.- Configs
model_type (
str
) β {βv4β, βv4tinyβ}, default=βv4tinyβ.
Defines the type of YOLO model to be used.weights_parent_dir (
Optional[str]
) β default = null.
Change the parent directory where weights will be stored by replacingnull
with an absolute path to the desired directory.detect (
List[int]
) β default = [0, 1].
List of object class IDs to be detected where no_mask is0
and mask is1
.max_output_size_per_class (
int
) β default = 50.
Maximum number of detected instances for each class in an image.max_total_size (
int
) β default = 50.
Maximum total number of detected instances in an image.iou_threshold (
float
) β [0, 1], default = 0.1.
Overlapping bounding boxes above the specified IoU (Intersection over Union) threshold are discarded.score_threshold (
float
) β [0, 1], default = 0.7.
Bounding box with confidence score less than the specified confidence score threshold is discarded.
References
YOLOv4: Optimal Speed and Accuracy of Object Detection: https://arxiv.org/pdf/2004.10934v1.pdf
Model weights trained using pretrained weights from Darknet: https://github.com/AlexeyAB/darknet
Changed in version 1.2.0:
yolo_iou_threshold
is renamed toiou_threshold
.
yolo_score_threshold
is renamed toscore_threshold
.