COCOeval
- class faster_coco_eval.core.cocoeval.COCOeval(cocoGt=None, cocoDt=None, iouType='segm', ranges=None, print_function=<bound method Logger.info of <Logger faster_coco_eval.core.cocoeval (WARNING)>>, extra_calc=False, kpt_oks_sigmas=None, use_area=True, lvis_style=False, separate_eval=False, boundary_dilation_ratio=0.02, boundary_cpu_count=4, rle_iou_max_workers=8)
Bases:
object- accumulate(p=None)
Deprecated. Use COCOeval_faster.accumulate instead.
- Parameters:
p – Unused.
- Raises:
DeprecationWarning – Always.
- computeIoU(imgId, catId)
Compute IoU between ground truth and detection for a given image and category.
- Parameters:
imgId (
int) – Image ID.catId (
int) – Category ID.
- Returns:
IoUs between gt and dt for the given image and category.
- Return type:
list[float] |ndarray
- computeOks(imgId, catId)
Compute OKS between ground truth and detection for a given image and category.
- Parameters:
imgId (
int) – Image ID.catId (
int) – Category ID.
- Returns:
OKS between gt and dt for the given image and category.
- Return type:
ndarray
- evaluate()
Deprecated. Use COCOeval_faster.evaluate instead.
- Raises:
DeprecationWarning – Always.
- evaluateImg(imgId, catId, aRng, maxDet)
Deprecated. Use COCOeval_faster.evaluateImg instead.
- Parameters:
imgId – Image ID.
catId – Category ID.
aRng – Area range.
maxDet – Maximum detections.
- Raises:
DeprecationWarning – Always.
- get_type_result(first=0.01, second=0.85)
Calculate type results for easy, medium, and hard splits.
- Parameters:
first (
float) – Threshold for ‘easy’ crowdIndex.second (
float) – Threshold for ‘medium’ crowdIndex.
- Returns:
List of scores for [easy, medium, hard].
- Return type:
list
- property print_function: Callable
Returns: Callable: The function used for printing/logging.
- split(gt_file, first=0.01, second=0.85)
Split images into easy, medium, hard according to ‘crowdIndex’.
- Parameters:
gt_file (
str) – Path to the ground truth file.first (
float) – Threshold for ‘easy’ crowdIndex.second (
float) – Threshold for ‘medium’ crowdIndex.
- Returns:
Lists of image ids for (easy, medium, hard).
- Return type:
tuple
- summarize()
Compute and display summary metrics for evaluation results. After calling this method, self.all_stats will contain the full results including all metrics while self.stats contains a subset of the most commonly used metrics.
The summary layout adapts to the configured area ranges and maximum detection counts.
statscontains the metrics before the IoU-specific recall summaries, whileall_statscontains every generated metric.