@@ -38,13 +38,37 @@ def calculate_thresholds(all_gt: List[List],
38
38
"""
39
39
For given IoU thresh, calculate confidence thresh for precisions from 0.0 to 1.0 .
40
40
41
- :param all_gt: All ground truth objects from a subset
42
- [image_id(str), category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
43
- :param all_det: All prediction objects from a subset
44
- [image_id(str), category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
45
- :param iou_thresh: IoU threshold
46
- :return [
47
- {"conf_thresh": xxx, "recall": xxx, "precision": xxx, "precision_thresh": xxx}
41
+ :param all_gt: All ground truth objects from a subset.
42
+
43
+ .. code-block:: python
44
+
45
+ [
46
+ # [image_id, category_id, [x1, y1, x2, y2]]
47
+ [1, 1, [10, 20, 30, 40]],
48
+ ]
49
+
50
+ :param all_det: All prediction objects from a subset.
51
+
52
+ .. code-block:: python
53
+
54
+ [
55
+ # [image_id, category_id, [x1, y1, x2, y2], conf]
56
+ [1, 1, [10, 20, 33, 43], 0.8],
57
+ ]
58
+
59
+ :param iou_thresh: float.
60
+
61
+ :return conf thresholds: list of dict.
62
+
63
+ .. code-block:: python
64
+
65
+ [
66
+ {
67
+ "conf_thresh": 10,
68
+ "recall": 10,
69
+ "precision": 10,
70
+ "precision_thresh": 10.1
71
+ }
48
72
]
49
73
"""
50
74
@@ -159,14 +183,17 @@ def calculate_fnfp(all_gt: List[List],
159
183
"""
160
184
For given IoU thresh, check the correctness of all predictions in an image.
161
185
162
- :param all_gt: All ground truth objects from a subset
163
- [category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
164
- :param all_det: All prediction objects from a subset
165
- [category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
186
+ :param all_gt:
187
+ | All ground truth objects from a subset
188
+ | [category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
189
+ :param all_det:
190
+ | All prediction objects from a subset
191
+ | [category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
166
192
:param iou_thresh: IoU threshold
167
- :return (gt_results, det_results)
168
- gt_results, list, -1 means FN, otherwise means matched det id
169
- det_results, list, 1 means TP, 0 means FP
193
+ :return tuple of list of int:
194
+ | (gt_results, det_results)
195
+ | gt_results, list, -1 means FN, otherwise means matched det id
196
+ | det_results, list, 1 means TP, 0 means FP
170
197
"""
171
198
172
199
gt_arr = np .array (all_gt [:], dtype = np .float32 )
0 commit comments