deeplabcut.core.metrics.bbox
Bounding box metrics.
Metrics are currently computed using pycocotools, which can be installed with pypi
(see https://github.com/ppwwyyxx/cocoapi/tree/master).
Functions:
| Name | Description |
|---|---|
compute_bbox_metrics |
Computes bbox mAP and mAR metrics for bounding boxes. |
compute_bbox_metrics
compute_bbox_metrics(ground_truth: dict[str, dict], detections: dict[str, dict]) -> dict[str, float]
Computes bbox mAP and mAR metrics for bounding boxes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, dict]
|
A dictionary mapping image UIDs (such as image paths or filenames) to a ground truth labels dict. The labels dict should contain the keys "width" (image width), "height" (image height) and "bboxes" (a numpy array of shape (num_gt_bboxes, 4) containing the ground truth bounding boxes in format xywh). |
required |
|
dict[str, dict]
|
A dictionary mapping image UIDs (such as image paths or filenames) to a predicted bounding box dict. The detections dict should contain the keys "bboxes" (a numpy array of shape (num_detected_bboxes, 4) containing the predicted bounding boxes in format xywh) and "scores" (a numpy array of length num_detected_bboxes containing the confidence score for each predicted bounding box). |
required |
Returns:
| Type | Description |
|---|---|
dict[str, float]
|
The bounding box mAP/mAR metrics in a dictionary. |
Raises:
| Type | Description |
|---|---|
ModuleNotFoundError
|
if |
ValueError
|
if there are mismatches in the keys of ground_truth and detections |
Source code in deeplabcut/core/metrics/bbox.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |