Skip to content
Snippets Groups Projects
Unverified Commit 9dd4334b authored by Yuchen Fan's avatar Yuchen Fan Committed by GitHub
Browse files

Add support for string ids for COCO dataset

parent 86e25e41
No related branches found
No related tags found
No related merge requests found
......@@ -16,14 +16,14 @@ class CocoDataset(CustomDataset):
self.img_ids = self.coco.getImgIds()
img_infos = []
for i in self.img_ids:
info = self.coco.loadImgs(i)[0]
info = self.coco.loadImgs([i])[0]
info['filename'] = info['file_name']
img_infos.append(info)
return img_infos
def get_ann_info(self, idx):
img_id = self.img_infos[idx]['id']
ann_ids = self.coco.getAnnIds(imgIds=img_id)
ann_ids = self.coco.getAnnIds(imgIds=[img_id])
ann_info = self.coco.loadAnns(ann_ids)
return self._parse_ann_info(ann_info)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment