faster-coco-eval 1.5.2__tar.gz → 1.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {faster_coco_eval-1.5.2/faster_coco_eval.egg-info → faster_coco_eval-1.5.4}/PKG-INFO +4 -1
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/README.md +3 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/core/coco.py +26 -17
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/core/cocoeval.py +47 -13
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/core/faster_eval_api.py +21 -11
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/draw.py +45 -8
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/extra.py +12 -1
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/version.py +1 -1
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4/faster_coco_eval.egg-info}/PKG-INFO +4 -1
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/LICENSE +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/MANIFEST.in +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/faster_eval_api/coco_eval/cocoeval.cpp +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/faster_eval_api/coco_eval/cocoeval.h +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/faster_eval_api/faster_eval_api.cpp +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/mask/common/maskApi.c +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/mask/common/maskApi.h +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/mask/pycocotools/_mask.pyx +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/__init__.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/core/__init__.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/core/mask.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/__init__.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/curves.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/display.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval/extra/utils.py +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval.egg-info/SOURCES.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval.egg-info/dependency_links.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval.egg-info/requires.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval.egg-info/top_level.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/pyproject.toml +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/requirements/extra.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/requirements/runtime.txt +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/setup.cfg +0 -0
- {faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: faster-coco-eval
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.4
|
|
4
4
|
Summary: Faster interpretation of the original COCOEval
|
|
5
5
|
Home-page: https://github.com/MiXaiLL76/faster_coco_eval
|
|
6
6
|
Author: MiXaiLL76
|
|
@@ -32,6 +32,9 @@ https://pypi.org/project/faster-coco-eval/)
|
|
|
32
32
|
[](https://github.com/MiXaiLL76/faster_coco_eval/wiki)
|
|
33
33
|
[](https://github.com/MiXaiLL76/faster_coco_eval/blob/main/LICENSE)
|
|
34
34
|
|
|
35
|
+
[](https://github.com/MiXaiLL76/faster_coco_eval/actions/workflows/unittest.yml)
|
|
36
|
+
<!-- [](https://codecov.io/gh/MiXaiLL76/faster_coco_eval) -->
|
|
37
|
+
|
|
35
38
|
## Disclaimer
|
|
36
39
|
|
|
37
40
|
I often use this project, but I saw it abandoned and without a public repository on github.
|
|
@@ -7,6 +7,9 @@ https://pypi.org/project/faster-coco-eval/)
|
|
|
7
7
|
[](https://github.com/MiXaiLL76/faster_coco_eval/wiki)
|
|
8
8
|
[](https://github.com/MiXaiLL76/faster_coco_eval/blob/main/LICENSE)
|
|
9
9
|
|
|
10
|
+
[](https://github.com/MiXaiLL76/faster_coco_eval/actions/workflows/unittest.yml)
|
|
11
|
+
<!-- [](https://codecov.io/gh/MiXaiLL76/faster_coco_eval) -->
|
|
12
|
+
|
|
10
13
|
## Disclaimer
|
|
11
14
|
|
|
12
15
|
I often use this project, but I saw it abandoned and without a public repository on github.
|
|
@@ -90,7 +90,7 @@ class COCO:
|
|
|
90
90
|
if type(annotation_file) is str:
|
|
91
91
|
self.dataset = self.load_json(annotation_file)
|
|
92
92
|
elif type(annotation_file) is dict:
|
|
93
|
-
self.dataset = annotation_file
|
|
93
|
+
self.dataset = copy.deepcopy(annotation_file)
|
|
94
94
|
else:
|
|
95
95
|
self.dataset = None
|
|
96
96
|
|
|
@@ -214,21 +214,29 @@ class COCO:
|
|
|
214
214
|
cats = self.dataset["categories"]
|
|
215
215
|
else:
|
|
216
216
|
cats = self.dataset["categories"]
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
217
|
+
|
|
218
|
+
if len(catNms) > 0:
|
|
219
|
+
name_to_cat = {cat.get("name"): cat for cat in cats}
|
|
220
|
+
cats = [
|
|
221
|
+
name_to_cat[label]
|
|
222
|
+
for label in catNms
|
|
223
|
+
if name_to_cat.get(label)
|
|
224
|
+
]
|
|
225
|
+
|
|
226
|
+
if len(supNms) > 0:
|
|
227
|
+
supercategory_to_cat = {
|
|
228
|
+
cat.get("supercategory"): cat for cat in cats
|
|
229
|
+
}
|
|
230
|
+
cats = [
|
|
231
|
+
supercategory_to_cat[label]
|
|
232
|
+
for label in supNms
|
|
233
|
+
if supercategory_to_cat.get(label)
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
if len(catIds) > 0:
|
|
237
|
+
id_to_cat = {cat.get("id"): cat for cat in cats}
|
|
238
|
+
cats = [id_to_cat[idx] for idx in catIds if id_to_cat.get(idx)]
|
|
239
|
+
|
|
232
240
|
ids = [cat["id"] for cat in cats]
|
|
233
241
|
return ids
|
|
234
242
|
|
|
@@ -314,7 +322,8 @@ class COCO:
|
|
|
314
322
|
elif type(resFile) is np.ndarray:
|
|
315
323
|
anns = self.loadNumpyAnnotations(resFile)
|
|
316
324
|
else:
|
|
317
|
-
anns = resFile
|
|
325
|
+
anns = copy.deepcopy(resFile)
|
|
326
|
+
|
|
318
327
|
assert type(anns) is list, "results in not an array of objects"
|
|
319
328
|
|
|
320
329
|
anns = [ann for ann in anns if ann.get("score", 1) >= self.score_tresh]
|
|
@@ -70,6 +70,7 @@ class COCOeval:
|
|
|
70
70
|
iouType="segm",
|
|
71
71
|
print_function=logger.debug,
|
|
72
72
|
extra_calc=False,
|
|
73
|
+
kpt_oks_sigmas=None,
|
|
73
74
|
):
|
|
74
75
|
"""Initialize CocoEval using coco APIs for gt and dt :param cocoGt:
|
|
75
76
|
|
|
@@ -88,7 +89,9 @@ class COCOeval:
|
|
|
88
89
|
self.eval: dict = {} # accumulated evaluation results
|
|
89
90
|
self._gts = defaultdict(list) # gt for evaluation
|
|
90
91
|
self._dts = defaultdict(list) # dt for evaluation
|
|
91
|
-
self.params = Params(
|
|
92
|
+
self.params = Params(
|
|
93
|
+
iouType=iouType, kpt_sigmas=kpt_oks_sigmas
|
|
94
|
+
) # parameters
|
|
92
95
|
self._paramsEval: dict = {} # parameters for evaluation
|
|
93
96
|
self.stats: list = [] # result summarization
|
|
94
97
|
self.ious: dict = {} # ious between all gts and dts
|
|
@@ -100,6 +103,18 @@ class COCOeval:
|
|
|
100
103
|
self.params.imgIds = sorted(cocoGt.getImgIds())
|
|
101
104
|
self.params.catIds = sorted(cocoGt.getCatIds())
|
|
102
105
|
|
|
106
|
+
if iouType == "keypoints":
|
|
107
|
+
if cocoDt is not None:
|
|
108
|
+
self.params.catIds = sorted(list(cocoDt.cat_img_map.keys()))
|
|
109
|
+
else:
|
|
110
|
+
self.params.catIds = sorted(
|
|
111
|
+
[
|
|
112
|
+
category_id
|
|
113
|
+
for category_id, category in cocoGt.cats.items()
|
|
114
|
+
if len(category.get("keypoints", []))
|
|
115
|
+
]
|
|
116
|
+
)
|
|
117
|
+
|
|
103
118
|
self.print_function = print_function # output print function
|
|
104
119
|
|
|
105
120
|
def _prepare(self):
|
|
@@ -136,7 +151,7 @@ class COCOeval:
|
|
|
136
151
|
gt["ignore"] = gt["ignore"] if "ignore" in gt else 0
|
|
137
152
|
gt["ignore"] = "iscrowd" in gt and gt["iscrowd"]
|
|
138
153
|
if p.iouType == "keypoints":
|
|
139
|
-
gt["ignore"] = (gt
|
|
154
|
+
gt["ignore"] = (gt.get("num_keypoints") == 0) or gt["ignore"]
|
|
140
155
|
self._gts = defaultdict(list) # gt for evaluation
|
|
141
156
|
self._dts = defaultdict(list) # dt for evaluation
|
|
142
157
|
for gt in gts:
|
|
@@ -466,16 +481,32 @@ class COCOeval:
|
|
|
466
481
|
|
|
467
482
|
def _summarizeKps():
|
|
468
483
|
stats = np.zeros((10,))
|
|
469
|
-
stats[0] = _summarize(1, maxDets=
|
|
470
|
-
stats[1] = _summarize(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
stats[
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
stats[
|
|
477
|
-
|
|
478
|
-
|
|
484
|
+
stats[0] = _summarize(1, maxDets=self.params.maxDets[-1])
|
|
485
|
+
stats[1] = _summarize(
|
|
486
|
+
1, maxDets=self.params.maxDets[-1], iouThr=0.5
|
|
487
|
+
)
|
|
488
|
+
stats[2] = _summarize(
|
|
489
|
+
1, maxDets=self.params.maxDets[-1], iouThr=0.75
|
|
490
|
+
)
|
|
491
|
+
stats[3] = _summarize(
|
|
492
|
+
1, maxDets=self.params.maxDets[-1], areaRng="medium"
|
|
493
|
+
)
|
|
494
|
+
stats[4] = _summarize(
|
|
495
|
+
1, maxDets=self.params.maxDets[-1], areaRng="large"
|
|
496
|
+
)
|
|
497
|
+
stats[5] = _summarize(0, maxDets=self.params.maxDets[-1])
|
|
498
|
+
stats[6] = _summarize(
|
|
499
|
+
0, maxDets=self.params.maxDets[-1], iouThr=0.5
|
|
500
|
+
)
|
|
501
|
+
stats[7] = _summarize(
|
|
502
|
+
0, maxDets=self.params.maxDets[-1], iouThr=0.75
|
|
503
|
+
)
|
|
504
|
+
stats[8] = _summarize(
|
|
505
|
+
0, maxDets=self.params.maxDets[-1], areaRng="medium"
|
|
506
|
+
)
|
|
507
|
+
stats[9] = _summarize(
|
|
508
|
+
0, maxDets=self.params.maxDets[-1], areaRng="large"
|
|
509
|
+
)
|
|
479
510
|
return stats
|
|
480
511
|
|
|
481
512
|
if not self.eval:
|
|
@@ -534,6 +565,7 @@ class Params:
|
|
|
534
565
|
]
|
|
535
566
|
self.areaRngLbl = ["all", "medium", "large"]
|
|
536
567
|
self.useCats = 1
|
|
568
|
+
|
|
537
569
|
self.kpt_oks_sigmas = (
|
|
538
570
|
np.array(
|
|
539
571
|
[
|
|
@@ -559,11 +591,13 @@ class Params:
|
|
|
559
591
|
/ 10.0
|
|
560
592
|
)
|
|
561
593
|
|
|
562
|
-
def __init__(self, iouType="segm"):
|
|
594
|
+
def __init__(self, iouType="segm", kpt_sigmas=None):
|
|
563
595
|
if iouType == "segm" or iouType == "bbox":
|
|
564
596
|
self.setDetParams()
|
|
565
597
|
elif iouType == "keypoints":
|
|
566
598
|
self.setKpParams()
|
|
599
|
+
if kpt_sigmas is not None:
|
|
600
|
+
self.kpt_oks_sigmas = np.array(kpt_sigmas)
|
|
567
601
|
else:
|
|
568
602
|
raise Exception("iouType not supported")
|
|
569
603
|
self.iouType = iouType
|
|
@@ -169,7 +169,7 @@ class COCOeval_faster(COCOeval):
|
|
|
169
169
|
self.eval["counts"][0], self.eval["counts"][3], -1
|
|
170
170
|
)
|
|
171
171
|
)
|
|
172
|
-
assert self.ground_truth_matches.shape[1]
|
|
172
|
+
assert self.ground_truth_matches.shape[1] <= len(
|
|
173
173
|
self.cocoGt.anns
|
|
174
174
|
)
|
|
175
175
|
|
|
@@ -178,7 +178,7 @@ class COCOeval_faster(COCOeval):
|
|
|
178
178
|
self.eval["counts"][0], self.eval["counts"][3], -1
|
|
179
179
|
)
|
|
180
180
|
)
|
|
181
|
-
assert self.ground_truth_orig_id.shape[1]
|
|
181
|
+
assert self.ground_truth_orig_id.shape[1] <= len(
|
|
182
182
|
self.cocoGt.anns
|
|
183
183
|
)
|
|
184
184
|
self.math_matches()
|
|
@@ -262,9 +262,21 @@ class COCOeval_faster(COCOeval):
|
|
|
262
262
|
g.append(gt_ann["bbox"])
|
|
263
263
|
d.append(dt_ann["bbox"])
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
iscrowd = [0 for _ in g]
|
|
266
|
+
|
|
267
|
+
_iou = maskUtils.iou(d, g, iscrowd)
|
|
268
|
+
|
|
269
|
+
if len(_iou) == 0:
|
|
270
|
+
return 0
|
|
271
|
+
else:
|
|
272
|
+
return _iou.max()
|
|
266
273
|
|
|
267
274
|
def compute_mIoU(self, categories=None, raw=False):
|
|
275
|
+
if self.params.iouType == "keypoints":
|
|
276
|
+
return np.array(
|
|
277
|
+
[val.max() for val in self.ious.values() if len(val)]
|
|
278
|
+
).mean()
|
|
279
|
+
|
|
268
280
|
g = []
|
|
269
281
|
d = []
|
|
270
282
|
s = []
|
|
@@ -283,7 +295,7 @@ class COCOeval_faster(COCOeval):
|
|
|
283
295
|
else:
|
|
284
296
|
raise Exception("unknown iouType for iou computation")
|
|
285
297
|
|
|
286
|
-
iscrowd = [0 for
|
|
298
|
+
iscrowd = [0 for _ in g]
|
|
287
299
|
|
|
288
300
|
ious = maskUtils.iou(d, g, iscrowd)
|
|
289
301
|
if raw:
|
|
@@ -322,11 +334,6 @@ class COCOeval_faster(COCOeval):
|
|
|
322
334
|
|
|
323
335
|
@property
|
|
324
336
|
def stats_as_dict(self):
|
|
325
|
-
iouType = self.params.iouType
|
|
326
|
-
assert (
|
|
327
|
-
iouType == "segm" or iouType == "bbox"
|
|
328
|
-
), "iouType={} not supported".format(iouType)
|
|
329
|
-
|
|
330
337
|
labels = [
|
|
331
338
|
"AP_all",
|
|
332
339
|
"AP_50",
|
|
@@ -340,10 +347,13 @@ class COCOeval_faster(COCOeval):
|
|
|
340
347
|
"AR_small",
|
|
341
348
|
"AR_medium",
|
|
342
349
|
"AR_large",
|
|
343
|
-
"AR_50",
|
|
344
|
-
"AR_75",
|
|
345
350
|
]
|
|
346
351
|
|
|
352
|
+
if self.params.iouType in ["segm", "bbox"]:
|
|
353
|
+
labels += ["AR_50", "AR_75"]
|
|
354
|
+
else:
|
|
355
|
+
labels = [label for label in labels if "small" not in label]
|
|
356
|
+
|
|
347
357
|
if self.matched:
|
|
348
358
|
labels += [
|
|
349
359
|
"mIoU",
|
|
@@ -26,6 +26,7 @@ def generate_ann_polygon(
|
|
|
26
26
|
iouType: str = "bbox",
|
|
27
27
|
text: Optional[str] = None,
|
|
28
28
|
legendgroup: Optional[str] = None,
|
|
29
|
+
category_id_to_skeleton: Optional[dict] = None,
|
|
29
30
|
):
|
|
30
31
|
all_x = []
|
|
31
32
|
all_y = []
|
|
@@ -34,7 +35,7 @@ def generate_ann_polygon(
|
|
|
34
35
|
x1, y1, w, h = ann["bbox"]
|
|
35
36
|
all_x = [x1, x1 + w, x1 + w, x1, x1, None]
|
|
36
37
|
all_y = [y1, y1, y1 + h, y1 + h, y1, None]
|
|
37
|
-
|
|
38
|
+
elif iouType == "segm":
|
|
38
39
|
ann = convert_ann_rle_to_poly(ann)
|
|
39
40
|
|
|
40
41
|
for poly in ann["segmentation"]:
|
|
@@ -43,6 +44,29 @@ def generate_ann_polygon(
|
|
|
43
44
|
poly = np.array(poly).reshape(-1, 2)
|
|
44
45
|
all_x += poly[:, 0].tolist() + [None]
|
|
45
46
|
all_y += poly[:, 1].tolist() + [None]
|
|
47
|
+
elif iouType == "keypoints":
|
|
48
|
+
skeleton = category_id_to_skeleton.get(ann.get("category_id"))
|
|
49
|
+
keypoints = ann.get("keypoints")
|
|
50
|
+
|
|
51
|
+
if (skeleton is None) or (keypoints is None):
|
|
52
|
+
return
|
|
53
|
+
|
|
54
|
+
xyz = np.int0(keypoints).reshape(-1, 3)
|
|
55
|
+
ready_bones = {i: True for i in range(xyz.shape[0])}
|
|
56
|
+
for p1, p2 in skeleton:
|
|
57
|
+
if ready_bones.get(p1 - 1, False) and ready_bones.get(
|
|
58
|
+
p2 - 1, False
|
|
59
|
+
):
|
|
60
|
+
all_x += [xyz[int(p1 - 1), 0], xyz[int(p2 - 1), 0], None]
|
|
61
|
+
all_y += [xyz[int(p1 - 1), 1], xyz[int(p2 - 1), 1], None]
|
|
62
|
+
|
|
63
|
+
if ann.get("bbox"):
|
|
64
|
+
x1, y1, w, h = ann.get("bbox")
|
|
65
|
+
all_x += [x1, x1 + w, x1 + w, x1, x1, None]
|
|
66
|
+
all_y += [y1, y1, y1 + h, y1 + h, y1, None]
|
|
67
|
+
|
|
68
|
+
else:
|
|
69
|
+
raise ValueError()
|
|
46
70
|
|
|
47
71
|
return go.Scatter(
|
|
48
72
|
x=all_x,
|
|
@@ -103,6 +127,10 @@ def display_image(
|
|
|
103
127
|
categories_labels = {
|
|
104
128
|
category["id"]: category["name"] for _, category in cocoGt.cats.items()
|
|
105
129
|
}
|
|
130
|
+
category_id_to_skeleton = {
|
|
131
|
+
category["id"]: category.get("skeleton")
|
|
132
|
+
for _, category in cocoGt.cats.items()
|
|
133
|
+
}
|
|
106
134
|
|
|
107
135
|
if len(gt_anns) > 0:
|
|
108
136
|
for ann in gt_anns.values():
|
|
@@ -118,8 +146,10 @@ def display_image(
|
|
|
118
146
|
categories_labels[ann["category_id"]],
|
|
119
147
|
),
|
|
120
148
|
legendgroup="fn",
|
|
149
|
+
category_id_to_skeleton=category_id_to_skeleton,
|
|
121
150
|
)
|
|
122
|
-
|
|
151
|
+
if poly is not None:
|
|
152
|
+
polygons.append(poly)
|
|
123
153
|
else:
|
|
124
154
|
if display_gt:
|
|
125
155
|
poly = generate_ann_polygon(
|
|
@@ -131,8 +161,10 @@ def display_image(
|
|
|
131
161
|
categories_labels[ann["category_id"]],
|
|
132
162
|
),
|
|
133
163
|
legendgroup="gt",
|
|
164
|
+
category_id_to_skeleton=category_id_to_skeleton,
|
|
134
165
|
)
|
|
135
|
-
|
|
166
|
+
if poly is not None:
|
|
167
|
+
polygons.append(poly)
|
|
136
168
|
|
|
137
169
|
if len(dt_anns) > 0:
|
|
138
170
|
for ann in dt_anns.values():
|
|
@@ -156,8 +188,10 @@ def display_image(
|
|
|
156
188
|
ann["iou"],
|
|
157
189
|
),
|
|
158
190
|
legendgroup="tp",
|
|
191
|
+
category_id_to_skeleton=category_id_to_skeleton,
|
|
159
192
|
)
|
|
160
|
-
|
|
193
|
+
if poly is not None:
|
|
194
|
+
polygons.append(poly)
|
|
161
195
|
else:
|
|
162
196
|
if display_fp:
|
|
163
197
|
poly = generate_ann_polygon(
|
|
@@ -175,8 +209,10 @@ def display_image(
|
|
|
175
209
|
ann["score"],
|
|
176
210
|
),
|
|
177
211
|
legendgroup="fp",
|
|
212
|
+
category_id_to_skeleton=category_id_to_skeleton,
|
|
178
213
|
)
|
|
179
|
-
|
|
214
|
+
if poly is not None:
|
|
215
|
+
polygons.append(poly)
|
|
180
216
|
|
|
181
217
|
fig = px.imshow(
|
|
182
218
|
im,
|
|
@@ -188,9 +224,10 @@ def display_image(
|
|
|
188
224
|
|
|
189
225
|
legends = {}
|
|
190
226
|
for poly in polygons:
|
|
191
|
-
if
|
|
192
|
-
poly.
|
|
193
|
-
|
|
227
|
+
if poly is not None:
|
|
228
|
+
if legends.get(poly.legendgroup) is None:
|
|
229
|
+
poly.showlegend = True
|
|
230
|
+
legends[poly.legendgroup] = True
|
|
194
231
|
|
|
195
232
|
fig.add_trace(poly)
|
|
196
233
|
|
|
@@ -18,6 +18,7 @@ class ExtraEval:
|
|
|
18
18
|
iou_tresh: float = 0.0,
|
|
19
19
|
recall_count: int = 100,
|
|
20
20
|
useCats: bool = False,
|
|
21
|
+
kpt_oks_sigmas: list = None,
|
|
21
22
|
):
|
|
22
23
|
self.iouType = iouType
|
|
23
24
|
self.min_score = min_score
|
|
@@ -28,6 +29,12 @@ class ExtraEval:
|
|
|
28
29
|
self.cocoDt = copy.deepcopy(cocoDt)
|
|
29
30
|
self.eval = None
|
|
30
31
|
|
|
32
|
+
if iouType == "keypoints":
|
|
33
|
+
self.useCats = True
|
|
34
|
+
self.kpt_oks_sigmas = np.array(kpt_oks_sigmas)
|
|
35
|
+
else:
|
|
36
|
+
self.kpt_oks_sigmas = None
|
|
37
|
+
|
|
31
38
|
assert self.cocoGt is not None, "cocoGt is empty"
|
|
32
39
|
|
|
33
40
|
if (self.cocoGt is not None) and (self.cocoDt is not None):
|
|
@@ -38,7 +45,11 @@ class ExtraEval:
|
|
|
38
45
|
assert self.cocoDt is not None, "cocoDt is empty"
|
|
39
46
|
|
|
40
47
|
cocoEval = COCOeval_faster(
|
|
41
|
-
self.cocoGt,
|
|
48
|
+
self.cocoGt,
|
|
49
|
+
self.cocoDt,
|
|
50
|
+
self.iouType,
|
|
51
|
+
extra_calc=True,
|
|
52
|
+
kpt_oks_sigmas=self.kpt_oks_sigmas,
|
|
42
53
|
)
|
|
43
54
|
cocoEval.params.maxDets = [len(self.cocoGt.anns)]
|
|
44
55
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "1.5.
|
|
1
|
+
__version__ = "1.5.4"
|
|
2
2
|
__author__ = "MiXaiLL76"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: faster-coco-eval
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.4
|
|
4
4
|
Summary: Faster interpretation of the original COCOEval
|
|
5
5
|
Home-page: https://github.com/MiXaiLL76/faster_coco_eval
|
|
6
6
|
Author: MiXaiLL76
|
|
@@ -32,6 +32,9 @@ https://pypi.org/project/faster-coco-eval/)
|
|
|
32
32
|
[](https://github.com/MiXaiLL76/faster_coco_eval/wiki)
|
|
33
33
|
[](https://github.com/MiXaiLL76/faster_coco_eval/blob/main/LICENSE)
|
|
34
34
|
|
|
35
|
+
[](https://github.com/MiXaiLL76/faster_coco_eval/actions/workflows/unittest.yml)
|
|
36
|
+
<!-- [](https://codecov.io/gh/MiXaiLL76/faster_coco_eval) -->
|
|
37
|
+
|
|
35
38
|
## Disclaimer
|
|
36
39
|
|
|
37
40
|
I often use this project, but I saw it abandoned and without a public repository on github.
|
|
File without changes
|
|
File without changes
|
{faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/csrc/faster_eval_api/coco_eval/cocoeval.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{faster_coco_eval-1.5.2 → faster_coco_eval-1.5.4}/faster_coco_eval.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|