vis4d.eval.coco¶
Detection evaluators.
- class COCODetectEvaluator(data_root, split='val2017', per_class_eval=False)[source]¶
COCO detection evaluation class.
Creates an instance of the class.
- Parameters:
data_root (str) – Root directory of data.
split (str, optional) – COCO data split. Defaults to “val2017”.
per_class_eval (bool, optional) – Per-class evaluation. Defaults to False.
- evaluate(metric)[source]¶
Evaluate COCO predictions.
- Parameters:
metric (str) – Metric to evaluate. Should be “COCO_AP”.
- Raises:
NotImplementedError – Raised if metric is not “COCO_AP”.
RuntimeError – Raised if no predictions are available.
- Returns:
- Dictionary of scores to log and a pretty
printed string.
- Return type:
tuple[MetricLogs, str]
- process_batch(coco_image_id, pred_boxes, pred_scores, pred_classes, pred_masks=None)[source]¶
Process sample and convert detections to coco format.
coco_image_id (list[int]): COCO image ID. pred_boxes (list[NDArrayNumber]): Predicted bounding boxes. pred_scores (list[NDArrayNumber]): Predicted scores for each box. pred_classes (list[NDArrayNumber]): Predicted classes for each box. pred_masks (None | list[NDArrayNumber], optional): Predicted masks.
- Return type:
None
- property metrics: list[str]¶
Supported metrics.
- Returns:
Metrics to evaluate.
- Return type:
list[str]
Modules
COCO evaluator. |