Object Detection (2D)#
Legacy Warning
Content in this section reflects outdated practices or deprecated features. It's recommended to avoid using these in new developments.
While existing implementations using these features will continue to receive support, we strongly advise adopting the latest standards and tools for new projects to ensure optimal performance and compatibility. For more information and up-to-date practices, please refer to our newest documentation at docs.kolena.io.
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.
-
Example: Object Detection (2D) ↗
2D Object Detection using the COCO dataset
TestSample
#
GroundTruth
#
Bases: GroundTruth
Ground truth type for the pre-built 2D Object Detection workflow.
bboxes: List[Union[LabeledBoundingBox, LabeledPolygon]]
instance-attribute
#
The ground truth LabeledBoundingBox
es or
LabeledPolygon
s associated with an image.
ignored_bboxes: List[Union[LabeledBoundingBox, LabeledPolygon]] = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
#
The ground truth LabeledBoundingBox
es or
LabeledPolygon
s to be ignored in evaluation associated with an
image.
Inference
#
Bases: Inference
Inference type for the pre-built 2D Object Detection workflow.
bboxes: List[Union[ScoredLabeledBoundingBox, ScoredLabeledPolygon]]
instance-attribute
#
The inference ScoredLabeledBoundingBox
es or
ScoredLabeledPolygon
s 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.
multiclass: Optional[bool] = None
class-attribute
instance-attribute
#
Optional flag to choose whether the SingleClass or Multiclass evaluator is run. If unset, the evaluator is determined based on the number of distinct labels in test data.
ObjectDetectionEvaluator(configurations=None)
#
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.