faster-coco-eval 1.5.6__tar.gz → 1.5.7__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.
Files changed (36) hide show
  1. {faster_coco_eval-1.5.6/faster_coco_eval.egg-info → faster_coco_eval-1.5.7}/PKG-INFO +1 -1
  2. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/core/coco.py +27 -24
  3. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/core/cocoeval.py +4 -9
  4. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/version.py +1 -1
  5. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7/faster_coco_eval.egg-info}/PKG-INFO +1 -1
  6. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/LICENSE +0 -0
  7. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/MANIFEST.in +0 -0
  8. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/README.md +0 -0
  9. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/faster_eval_api/coco_eval/cocoeval.cpp +0 -0
  10. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/faster_eval_api/coco_eval/cocoeval.h +0 -0
  11. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/faster_eval_api/faster_eval_api.cpp +0 -0
  12. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/mask/common/maskApi.c +0 -0
  13. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/mask/common/maskApi.h +0 -0
  14. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/csrc/mask/pycocotools/_mask.pyx +0 -0
  15. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/__init__.py +0 -0
  16. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/core/__init__.py +0 -0
  17. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/core/faster_eval_api.py +0 -0
  18. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/core/mask.py +0 -0
  19. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/__init__.py +0 -0
  20. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/curves.py +0 -0
  21. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/display.py +0 -0
  22. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/draw.py +0 -0
  23. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/extra.py +0 -0
  24. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval/extra/utils.py +0 -0
  25. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval.egg-info/SOURCES.txt +0 -0
  26. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval.egg-info/dependency_links.txt +0 -0
  27. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval.egg-info/requires.txt +0 -0
  28. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/faster_coco_eval.egg-info/top_level.txt +0 -0
  29. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/pyproject.toml +0 -0
  30. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/requirements/extra.txt +0 -0
  31. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/requirements/runtime.txt +0 -0
  32. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/requirements/tests.txt +0 -0
  33. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/setup.cfg +0 -0
  34. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/setup.py +0 -0
  35. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/tests/test_coco_metric.py +0 -0
  36. {faster_coco_eval-1.5.6 → faster_coco_eval-1.5.7}/tests/test_lvis_metric.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: faster-coco-eval
3
- Version: 1.5.6
3
+ Version: 1.5.7
4
4
  Summary: Faster interpretation of the original COCOEval
5
5
  Home-page: https://github.com/MiXaiLL76/faster_coco_eval
6
6
  Author: MiXaiLL76
@@ -174,40 +174,43 @@ class COCO:
174
174
  :return: ids (int array) : integer array of ann ids
175
175
 
176
176
  """
177
+ imgIds = imgIds if _isArrayLike(imgIds) else [imgIds]
178
+ catIds = catIds if _isArrayLike(catIds) else [catIds]
177
179
 
178
- anns = []
180
+ check_area = len(areaRng) > 0
181
+ check_crowd = iscrowd is not None
182
+ check_cat = len(catIds) > 0
183
+ check_img = len(imgIds) > 0
179
184
 
180
- if len(imgIds) != 0:
181
- for img_id in imgIds:
182
- anns.extend(self.img_ann_map[img_id])
183
- else:
185
+ if not (check_area and check_crowd and check_cat and check_img):
184
186
  anns = self.dataset["annotations"]
187
+ else:
188
+ anns = []
185
189
 
186
- # return early if no more filtering required
187
- if (len(catIds) == 0) and (len(areaRng) == 0) and (iscrowd is None):
188
- return [_ann["id"] for _ann in anns]
190
+ if check_img:
191
+ for img_id in imgIds:
192
+ anns.extend(self.img_ann_map[img_id])
193
+ else:
194
+ anns = self.dataset["annotations"]
189
195
 
190
- cat_ids = set(catIds)
196
+ if check_cat:
197
+ anns = [ann for ann in anns if ann["category_id"] in catIds]
191
198
 
192
- if len(areaRng) == 0:
193
- areaRng = [0, float("inf")]
199
+ if check_area:
200
+ areaRng = [0, float("inf")]
194
201
 
195
- imgIds = imgIds if _isArrayLike(imgIds) else [imgIds]
196
- catIds = catIds if _isArrayLike(catIds) else [catIds]
202
+ anns = [
203
+ ann
204
+ for ann in anns
205
+ if ann["area"] > areaRng[0] and ann["area"] < areaRng[1]
206
+ ]
197
207
 
198
- if iscrowd is None:
199
- iscrowd = False
208
+ if check_crowd:
209
+ anns = [ann for ann in anns if ann["iscrowd"] == iscrowd]
200
210
 
201
- ann_ids = [
202
- _ann["id"]
203
- for _ann in anns
204
- if _ann["category_id"] in cat_ids
205
- and _ann["area"] > areaRng[0]
206
- and _ann["area"] < areaRng[1]
207
- and int(_ann.get("iscrowd", 0)) == int(iscrowd)
208
- ]
211
+ ids = [ann["id"] for ann in anns]
209
212
 
210
- return ann_ids
213
+ return ids
211
214
 
212
215
  def getCatIds(self, catNms=[], supNms=[], catIds=[]):
213
216
  """Filtering parameters.
@@ -155,15 +155,10 @@ class COCOeval:
155
155
 
156
156
  # set ignore flag
157
157
  for gt in gts:
158
- if "ignore" not in gt:
159
- gt["ignore"] = 0
160
-
161
- if ("iscrowd" in gt) and (gt["ignore"] != 0):
162
- gt["ignore"] = gt["iscrowd"]
163
-
164
- if p.iouType == "keypoints" and (gt["ignore"] == 0):
165
- gt["ignore"] = int(gt.get("num_keypoints", 0) == 0)
166
-
158
+ gt["ignore"] = gt["ignore"] if "ignore" in gt else 0
159
+ gt["ignore"] = "iscrowd" in gt and gt["iscrowd"]
160
+ if p.iouType == "keypoints":
161
+ gt["ignore"] = (gt.get("num_keypoints") == 0) or gt["ignore"]
167
162
  self._gts = defaultdict(list) # gt for evaluation
168
163
  self._dts = defaultdict(list) # dt for evaluation
169
164
  img_pl = defaultdict(
@@ -1,2 +1,2 @@
1
- __version__ = "1.5.6"
1
+ __version__ = "1.5.7"
2
2
  __author__ = "MiXaiLL76"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: faster-coco-eval
3
- Version: 1.5.6
3
+ Version: 1.5.7
4
4
  Summary: Faster interpretation of the original COCOEval
5
5
  Home-page: https://github.com/MiXaiLL76/faster_coco_eval
6
6
  Author: MiXaiLL76