def mask_path_from_index(self, index):
        """
        given image index, cache high resolution mask and return full path of masks
        :param index: index of a specific image
        :return: full path of this mask
        """
        if self.data_name == 'val':
            return []
        cache_file = os.path.join(self.cache_path, 'COCOMask', self.data_name)
        if not os.path.exists(cache_file):
            os.makedirs(cache_file)
        # instance level segmentation
        filename = 'COCO_%s_%012d' % (self.data_name, index)
        gt_mask_file = os.path.join(cache_file, filename + '.hkl')
        return gt_mask_file

        given image index, cache high resolution mask and return full path of masks
        :param index: index of a specific image
        :return: full path of this mask
        
lib/dataset/coco.py