ObjectDetectionEvaluation#
- class ObjectDetectionEvaluation[source]#
Bases:
ClassificationEvaluation
- __init__(class_config: ClassConfig, iou_thresh: float = 0.5)[source]#
- Parameters:
class_config (ClassConfig) –
iou_thresh (float) –
Methods
__init__
(class_config[, iou_thresh])compute
(ground_truth_labels, prediction_labels)Compute metrics for a single scene.
Compute average metrics over all classes.
compute_eval_items
(gt_labels, pred_labels, ...)merge
(other[, scene_id])Merge Evaluation for another Scene into this one.
reset
()Reset the Evaluation.
save
(output_uri)Save this Evaluation to a file.
to_json
()Serialize to a dict or list.
- __init__(class_config: ClassConfig, iou_thresh: float = 0.5)[source]#
- Parameters:
class_config (ClassConfig) –
iou_thresh (float) –
- compute(ground_truth_labels: ObjectDetectionLabels, prediction_labels: ObjectDetectionLabels)[source]#
Compute metrics for a single scene.
- Parameters:
ground_truth_labels (ObjectDetectionLabels) – Ground Truth labels to evaluate against.
prediction_labels (ObjectDetectionLabels) – The predicted labels to evaluate.
- static compute_eval_items(gt_labels: ObjectDetectionLabels, pred_labels: ObjectDetectionLabels, class_config: ClassConfig, iou_thresh: float = 0.5) dict[int, rastervision.core.evaluation.class_evaluation_item.ClassEvaluationItem] [source]#
- Parameters:
gt_labels (ObjectDetectionLabels) –
pred_labels (ObjectDetectionLabels) –
class_config (ClassConfig) –
iou_thresh (float) –
- Return type:
dict[int, rastervision.core.evaluation.class_evaluation_item.ClassEvaluationItem]
- merge(other: ClassificationEvaluation, scene_id: str | None = None) None #
Merge Evaluation for another Scene into this one.
This is useful for computing the average metrics of a set of scenes. The results of the averaging are stored in this Evaluation.
- Parameters:
other (ClassificationEvaluation) – Evaluation to merge into this one
scene_id (str | None) – ID of scene. If specified, (a copy of)
other
will be saved and be available into_json()
’s output. Defaults to None.
- Return type:
None
- reset()#
Reset the Evaluation.