nrtk.impls.score_detections.coco_scorer

Defines COCOScorer, a ScoreDetections implementation that scores detections using COCO dataset metrics and formats.

Classes:

COCOScorer: Scores object detection results based on COCO evaluation metrics, allowing users to specify ground truth data and a particular statistic index to retrieve a sequence of metric scores.

Dependencies:
  • pycocotools for COCO data handling and evaluation.

  • smqtk_image_io for bounding box handling.

  • nrtk.interfaces for the ScoreDetections interface.

  • contextlib for suppressing unwanted output during COCO initialization.

Usage:

Instantiate COCOScorer with the path to the COCO-formatted ground truth data and specify the statistic index to be used for scoring. Call score with actual and predicted bounding boxes to obtain a sequence of float scores.

Example:

scorer = COCOScorer(gt_path=”path/to/ground_truth.json”, stat_index=0) scores = scorer.score(actual_detections, predicted_detections)

Classes

COCOScorer

An implementation of the ScoreDetection interface that conforms to the COCO data formatting and metrics.