diff --git a/python_module/megengine/data/dataset/vision/objects365.py b/python_module/megengine/data/dataset/vision/objects365.py index 84556d89e224e5f294a84b413b5369a2eb080c7d..7c1481bac99fa2af82fb8d93856b7815024373c9 100644 --- a/python_module/megengine/data/dataset/vision/objects365.py +++ b/python_module/megengine/data/dataset/vision/objects365.py @@ -129,7 +129,7 @@ class Objects365(VisionDataset): img_info = self.imgs[img_id] return img_info - class_name = ( + class_names = ( "person", "sneakers", "chair", diff --git a/python_module/megengine/data/dataset/vision/voc.py b/python_module/megengine/data/dataset/vision/voc.py index 95f373be9c0ff95c6f8693d8604d0346bc1695c4..42bf712dc172176ee040881a84ee8b2ed79a383b 100644 --- a/python_module/megengine/data/dataset/vision/voc.py +++ b/python_module/megengine/data/dataset/vision/voc.py @@ -93,7 +93,9 @@ class PascalVOC(VisionDataset): elif k == "boxes_category": anno = self.parse_voc_xml(ET.parse(self.annotations[index]).getroot()) boxes_category = [obj["name"] for obj in anno["annotation"]["object"]] - boxes_category = [self.class_names.index(bc) for bc in boxes_category] + boxes_category = [ + self.class_names.index(bc) + 1 for bc in boxes_category + ] boxes_category = np.array(boxes_category, dtype=np.int32) target.append(boxes_category) elif k == "mask":