Mapper
app.infrastructure.detection.model.mtcnn_torch.mapperMapper for converting MTCNN (facenet-pytorch) output to DetectionResult.
See Also
DetectionResult— normalized detection record produced by the mapperMTCNNTorchDetectionModel— runs the mapped model output
Layer: Infrastructure. Context: Implements concrete processing and I/O behind application-facing contracts.
MTCNNTorchDetectionMapper
Maps raw MTCNN (facenet-pytorch) detection output to DetectionResult format.
facenet_pytorch.MTCNN.detect() returns a pair (boxes, probs) where:
boxes–numpy.ndarrayof shape(N, 4)in xyxy order, orNonewhen no face is found.probs–numpy.ndarrayof shape(N,)with confidence scores in[0, 1], orNonewhen no face is found.
Layer: Infrastructure. Context: Implements concrete processing or I/O behind application-facing contracts.
map(boxes: 'np.ndarray | None', probs: 'np.ndarray | None', chosen_labels: list[str] | None = None) -> list[DetectionResult]
staticmethod
Map MTCNN raw inference output to a list of DetectionResult.
| PARAMETER | DESCRIPTION |
|---|---|
boxes
|
Array of bounding boxes in xyxy format, shape
TYPE:
|
probs
|
Array of confidence scores, shape
TYPE:
|
chosen_labels
|
Optional filter; results whose label is not in this
list are dropped. MTCNN always emits
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[DetectionResult]
|
List of |
list[DetectionResult]
|
threshold and optional label filter. |