Skip to content

Commit

Permalink
remove objects with iscrowd=True in Objects365
Browse files Browse the repository at this point in the history
Signed-off-by: tino926 <[email protected]>
  • Loading branch information
tino926 authored Jun 29, 2023
1 parent 0004c74 commit ff08404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/Objects365.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ download: |
path = Path(im["file_name"]) # image filename
try:
with open(labels / path.with_suffix('.txt').name, 'a') as file:
annIds = coco.getAnnIds(imgIds=im["id"], catIds=catIds, iscrowd=None)
annIds = coco.getAnnIds(imgIds=im["id"], catIds=catIds, iscrowd=False)
for a in coco.loadAnns(annIds):
x, y, w, h = a['bbox'] # bounding box in xywh (xy top-left corner)
xyxy = np.array([x, y, x + w, y + h])[None] # pixels(1,4)
Expand Down

1 comment on commit ff08404

@tino926
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to coco.py in pycocotools:

        if not iscrowd == None:
            ids = [ann['id'] for ann in anns if ann['iscrowd'] == iscrowd]
        else:
            ids = [ann['id'] for ann in anns]

should set iscrowd=False to remove the crowd annotations as stated in
#3392 (comment)

Please sign in to comment.