coco.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:alchemy 作者: voidrank 项目源码 文件源码
def __init__(self, annotation_file, ign_null_img=False):
        BaseDataset.__init__(self)
        self.annotation_file = annotation_file
        coco.COCO.__init__(self, annotation_file)

        for i in self.getImgIds():
            image_file_name = config.IMAGE_NAME_FORMAT % (config.IMAGE_SET, i)
            image_file_path = config.IMAGE_PATH_FORMAT % (config.IMAGE_SET, image_file_name)
            try:
                if len(self.imgToAnns[i]) == 0:
                    raise KeyError
                self.append(COCOItem(image_file_path, self.imgToAnns[i]))
            except KeyError:
                if ign_null_img is False:
                    self.append(COCOItem(image_file_path, []))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号