def image_path_from_index(self, index):
"""
Construct an image path from the image's "index" identifier.
"""
# Example image path for index=119993:
# train2014/COCO_train2014_000000119993.jpg
image = self.COCO.loadImgs(index)[0]
image_path = osp.join(self.data_dir, self.data_name, image['file_name'])
assert osp.exists(image_path), 'Path does not exist: {}'.format(image_path)
return image_path
评论列表
文章目录