-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix ignore * fix getAnnIds * bump version
- Loading branch information
Showing
4 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,40 +174,43 @@ def getAnnIds(self, imgIds=[], catIds=[], areaRng=[], iscrowd=None): | |
:return: ids (int array) : integer array of ann ids | ||
""" | ||
imgIds = imgIds if _isArrayLike(imgIds) else [imgIds] | ||
catIds = catIds if _isArrayLike(catIds) else [catIds] | ||
|
||
anns = [] | ||
check_area = len(areaRng) > 0 | ||
check_crowd = iscrowd is not None | ||
check_cat = len(catIds) > 0 | ||
check_img = len(imgIds) > 0 | ||
|
||
if len(imgIds) != 0: | ||
for img_id in imgIds: | ||
anns.extend(self.img_ann_map[img_id]) | ||
else: | ||
if not (check_area and check_crowd and check_cat and check_img): | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
MiXaiLL76
Author
Owner
|
||
anns = self.dataset["annotations"] | ||
else: | ||
anns = [] | ||
|
||
# return early if no more filtering required | ||
if (len(catIds) == 0) and (len(areaRng) == 0) and (iscrowd is None): | ||
return [_ann["id"] for _ann in anns] | ||
if check_img: | ||
for img_id in imgIds: | ||
anns.extend(self.img_ann_map[img_id]) | ||
else: | ||
anns = self.dataset["annotations"] | ||
|
||
cat_ids = set(catIds) | ||
if check_cat: | ||
anns = [ann for ann in anns if ann["category_id"] in catIds] | ||
|
||
if len(areaRng) == 0: | ||
areaRng = [0, float("inf")] | ||
if check_area: | ||
areaRng = [0, float("inf")] | ||
|
||
imgIds = imgIds if _isArrayLike(imgIds) else [imgIds] | ||
catIds = catIds if _isArrayLike(catIds) else [catIds] | ||
anns = [ | ||
ann | ||
for ann in anns | ||
if ann["area"] > areaRng[0] and ann["area"] < areaRng[1] | ||
] | ||
|
||
if iscrowd is None: | ||
iscrowd = False | ||
if check_crowd: | ||
anns = [ann for ann in anns if ann["iscrowd"] == iscrowd] | ||
|
||
ann_ids = [ | ||
_ann["id"] | ||
for _ann in anns | ||
if _ann["category_id"] in cat_ids | ||
and _ann["area"] > areaRng[0] | ||
and _ann["area"] < areaRng[1] | ||
and int(_ann.get("iscrowd", 0)) == int(iscrowd) | ||
] | ||
ids = [ann["id"] for ann in anns] | ||
|
||
return ann_ids | ||
return ids | ||
|
||
def getCatIds(self, catNms=[], supNms=[], catIds=[]): | ||
"""Filtering parameters. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = "1.5.6" | ||
__version__ = "1.5.7" | ||
__author__ = "MiXaiLL76" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
|
||
# history | ||
|
||
## v1.5.7 | ||
|
||
- [x] Compare COCOEval bug fix. | ||
|
||
## v1.5.6 | ||
|
||
- [x] Replace CED MSE curve with MAE (px) curve | ||
|
Pretty sure this should be
if not (check_area or check_crowd or check_cat or check_img)
Right now, it will take all annotations, unless all of the filters are used.