def load_annotations(self, ann_file):
    'Load annotation from COCO style annotation file.\n        Args:\n            ann_file (str): Path of annotation file.\n        Returns:\n            list[dict]: Annotation info from COCO api.\n        '
    self.coco = COCO(ann_file)
    self.cat_ids = self.coco.get_cat_ids(cat_names=self.CLASSES)
    self.cat2label = {cat_id: i for (i, cat_id) in enumerate(self.cat_ids)}
    self.img_ids = self.coco.get_img_ids()
    data_infos = []
    for i in self.img_ids:
        info = self.coco.load_imgs([i])[0]
        info['filename'] = info['file_name']
        data_infos.append(info)
    return data_infos
Load annotation from COCO style annotation file.
Args:
    ann_file (str): Path of annotation file.
Returns:
    list[dict]: Annotation info from COCO api.
def load_annotations(self, ann_file):
    'Load annotation from COCO style annotation file.\n        Args:\n            ann_file (str): Path of annotation file.\n        Returns:\n            list[dict]: Annotation info from COCO api.\n        '
    self.coco = COCO(ann_file)
    self.cat_ids = self.coco.get_cat_ids(cat_names=self.CLASSES)
    self.cat2label = {cat_id: i for (i, cat_id) in enumerate(self.cat_ids)}
    self.img_ids = self.coco.get_img_ids()
    data_infos = []
    for i in self.img_ids:
        info = self.coco.load_imgs([i])[0]
        info['filename'] = info['file_name']
        data_infos.append(info)
    return data_infos