datumaro.plugins.inference_server_plugin.samples.face_detection#
Classes
- class datumaro.plugins.inference_server_plugin.samples.face_detection.FaceDetectionModelInterpreter[source]#
Bases:
IModelInterpreter
- height = 400#
- width = 600#
- conf_threshold = 0.5#
- preprocess(inp: DatasetItem) Tuple[ndarray | Dict[str, ndarray], PrepInfo] [source]#
Preprocessing an dataset item input.
- Parameters:
img – DatasetItem input
- Returns:
It returns a tuple of preprocessed input and preprocessing information. The preprocessing information will be used in the postprocessing step. One use case for this would be an affine transformation of the output bounding box obtained by object detection models. Input images for those models are usually resized to fit the model input dimensions. As a result, the postprocessing step should refine the model output bounding box to match the original input image size.
- postprocess(pred: Dict[str, ndarray] | List[Dict[str, ndarray]], info: PrepInfo) List[Annotation] [source]#
Postprocess a model prediction.
- Parameters:
pred – Model prediction
info – Preprocessing information coming from the preprocessing step
- Returns:
A list of annotations which is created from the model predictions