Skip to content

Object Detection (2D)#

Experimental Feature

This pre-built workflow is an experimental feature. Experimental features are under active development and may occasionally undergo API-breaking changes.

Object Detection (OD) is a computer vision task that aims to classify and locate objects of interest presented in an image. So, it can be viewed as a combination of localization and classification tasks.

This pre-built workflow is prepared for a 2D Object Detection problem and here is an example of using this workflow on the COCO dataset.

ObjectDetectionEvaluator #

Bases: Evaluator

This ObjectDetectionEvaluator transforms inferences into metrics for the object detection workflow for a single class or multiple classes.

When a ThresholdConfiguration is configured to use an F1-Optimal threshold strategy, the evaluator requires that the first test case retrieved for a test suite contains the complete sample set.

For additional functionality, see the associated base class documentation.

TestSample #

Bases: Image

The Image sample type for the pre-built 2D Object Detection workflow.

metadata: Metadata = dataclasses.field(default_factory=dict) class-attribute instance-attribute #

The optional Metadata dictionary.

GroundTruth #

Bases: BaseGroundTruth

Ground truth type for the pre-built 2D Object Detection workflow.

bboxes: List[LabeledBoundingBox] instance-attribute #

The ground truth LabeledBoundingBoxes associated with an image.

ignored_bboxes: List[LabeledBoundingBox] = dataclasses.field(default_factory=list) class-attribute instance-attribute #

The ground truth LabeledBoundingBoxes to be ignored in evaluation associated with an image.

Inference #

Bases: BaseInference

Inference type for the pre-built 2D Object Detection workflow.

bboxes: List[ScoredLabeledBoundingBox] instance-attribute #

The inference ScoredLabeledBoundingBoxes associated with an image.

ignored: bool = False class-attribute instance-attribute #

Whether the image (and its associated inference bboxes) should be ignored in evaluating the results of the model.

ThresholdConfiguration #

Bases: EvaluatorConfiguration

Confidence and IoU ↗ threshold configuration for the pre-built 2D Object Detection workflow. Specify a confidence and IoU threshold to apply to all classes.

threshold_strategy: Union[Literal['F1-Optimal'], float] = 'F1-Optimal' class-attribute instance-attribute #

The confidence threshold strategy. It can either be a fixed confidence threshold such as 0.3 or 0.75, or the F1-optimal threshold by default.

iou_threshold: float = 0.5 class-attribute instance-attribute #

The IoU ↗ threshold, defaulting to 0.5.

min_confidence_score: float = 0.0 class-attribute instance-attribute #

The minimum confidence score to consider for the evaluation. This is usually set to reduce noise by excluding inferences with low confidence score.