BaseObjectModelOutputConverter

BaseObjectModelOutputConverter inheritance diagram
- class savant.base.converter.BaseObjectModelOutputConverter(**kwargs)
Base object model output converter.
- abstract __call__(*output_layers, model, roi, metadata=None)
Converts raw model output tensors to a numpy array that represents a list of detected bboxes in the format
(class_id, confidence, xc, yc, width, height, [angle])in absolute coordinates computed withROIinformation.- Parameters:
output_layers (ndarray | cupy.ndarray) – Model output layer tensors
model (ObjectModel) – Object model, required parameters: input tensor shape, maintain_aspect_ratio flag
roi (Tuple[float, float, float, float]) –
[top, left, width, height]of the rectangle on which the model infersmetadata (NvDsFrameMeta | None) – Frame metadata. Optional for backward compatibility.
- Returns:
BBox tensor
(class_id, confidence, xc, yc, width, height, [angle])offset by roi upper left and scaled by roi width and height- Return type:
ndarray | None
- tensor_format: TensorFormat = 0
Set to
CuPyto get theoutput_layerstensors in the converter call on the GPU as acupy.ndarray. Or set toNumPyto get tensors on the host as anumpy.ndarray.