BaseComplexModelOutputConverter

Inheritance diagram of BaseComplexModelOutputConverter

BaseComplexModelOutputConverter inheritance diagram

class savant.base.converter.BaseComplexModelOutputConverter(**kwargs)

Base complex model output converter.

abstract __call__(*output_layers, model, roi)

Converts raw model output tensors to Savant format.

Parameters:
  • output_layers (ndarray) – Model output layer tensors

  • model (ComplexModel) – Complex 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 infers

Returns:

a combination of BaseObjectModelOutputConverter and BaseAttributeModelOutputConverter outputs:

  • BBox tensor (class_id, confidence, xc, yc, width, height, [angle]) offset by roi upper left and scaled by roi width and height,

  • list of attributes values with confidences (attr_name, value, confidence)

Return type:

Tuple[ndarray, List[List[Tuple[str, Any, float]]]]