未验证 提交 82999c65 编写于 作者: W wangxinxin08 提交者: GitHub

modify coco.py to avoid problem due to string img_id (#2010)

上级 19e9368f
......@@ -65,7 +65,7 @@ class COCODataSet(DetDataset):
'and load image information only.'.format(anno_path))
for img_id in img_ids:
img_anno = coco.loadImgs(img_id)[0]
img_anno = coco.loadImgs([img_id])[0]
im_fname = img_anno['file_name']
im_w = float(img_anno['width'])
im_h = float(img_anno['height'])
......@@ -84,7 +84,7 @@ class COCODataSet(DetDataset):
continue
if not self.load_image_only:
ins_anno_ids = coco.getAnnIds(imgIds=img_id, iscrowd=False)
ins_anno_ids = coco.getAnnIds(imgIds=[img_id], iscrowd=False)
instances = coco.loadAnns(ins_anno_ids)
bboxes = []
......
......@@ -101,7 +101,7 @@ class COCODataSet(DataSet):
'and load image information only.'.format(anno_path))
for img_id in img_ids:
img_anno = coco.loadImgs(img_id)[0]
img_anno = coco.loadImgs([img_id])[0]
im_fname = img_anno['file_name']
im_w = float(img_anno['width'])
im_h = float(img_anno['height'])
......@@ -127,7 +127,7 @@ class COCODataSet(DataSet):
}
if not self.load_image_only:
ins_anno_ids = coco.getAnnIds(imgIds=img_id, iscrowd=False)
ins_anno_ids = coco.getAnnIds(imgIds=[img_id], iscrowd=False)
instances = coco.loadAnns(ins_anno_ids)
bboxes = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册