Skip to content
Snippets Groups Projects
Commit 6d9ee37b authored by Kai Chen's avatar Kai Chen
Browse files

add an attribute for CocoDataset

parent c96600b1
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,11 @@ class CocoDataset(CustomDataset):
def load_annotations(self, ann_file):
self.coco = COCO(ann_file)
cat_ids = self.coco.getCatIds()
self.cat2label = {cat_id: i + 1 for i, cat_id in enumerate(cat_ids)}
self.cat_ids = self.coco.getCatIds()
self.cat2label = {
cat_id: i + 1
for i, cat_id in enumerate(self.cat_ids)
}
self.img_ids = self.coco.getImgIds()
img_infos = []
for i in self.img_ids:
......
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