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.
-
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.
upload_object_detection_results(dataset_name, model_name, df, *, ground_truths_field='ground_truths', raw_inferences_field='raw_inferences', iou_threshold=0.5, threshold_strategy='F1-Optimal', min_confidence_score=0.01)
#
Compute metrics and upload results of the model for the dataset.
Dataframe df
should include a locator
column that would match to that of corresponding datapoint. Column
:inference in the Dataframe df
should be a list of scored BoundingBoxes
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_name
|
str
|
Dataset name. |
required |
model_name
|
str
|
Model name. |
required |
df
|
DataFrame
|
Dataframe for model results. |
required |
ground_truths_field
|
str
|
Field name in datapoint with ground truth bounding boxes, defaulting to |
'ground_truths'
|
raw_inferences_field
|
str
|
Column in model result DataFrame with raw inference bounding boxes, defaulting to |
'raw_inferences'
|
iou_threshold
|
float
|
The IoU ↗ threshold, defaulting to |
0.5
|
threshold_strategy
|
Union[Literal['F1-Optimal'], float, Dict[str, float]]
|
The confidence threshold strategy. It can either be a fixed confidence threshold such as |
'F1-Optimal'
|
min_confidence_score
|
float
|
The minimum confidence score to consider for the evaluation. This is usually set to reduce noise by excluding inferences with low confidence score. |
0.01
|
Returns:
Type | Description |
---|---|
None
|
|