未验证 提交 7b8c9eab 编写于 作者: W wangxinxin08 提交者: GitHub

fix COCODataset while eval without annotations (#2571)

上级 bc8b0d44
...@@ -90,6 +90,13 @@ class COCODataSet(DetDataset): ...@@ -90,6 +90,13 @@ class COCODataSet(DetDataset):
im_w, im_h, img_id)) im_w, im_h, img_id))
continue continue
coco_rec = {
'im_file': im_path,
'im_id': np.array([img_id]),
'h': im_h,
'w': im_w,
} if 'image' in self.data_fields else {}
if not self.load_image_only: 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) instances = coco.loadAnns(ins_anno_ids)
...@@ -161,13 +168,6 @@ class COCODataSet(DetDataset): ...@@ -161,13 +168,6 @@ class COCODataSet(DetDataset):
if has_segmentation and not any(gt_poly): if has_segmentation and not any(gt_poly):
continue continue
coco_rec = {
'im_file': im_path,
'im_id': np.array([img_id]),
'h': im_h,
'w': im_w,
} if 'image' in self.data_fields else {}
if is_rbox_anno: if is_rbox_anno:
gt_rec = { gt_rec = {
'is_crowd': is_crowd, 'is_crowd': is_crowd,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册