tzzcl / PSOL

code repository of “Rethinking the Route Towards Weakly Supervised Object Localization” in CVPR 2020

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get the file 'cache_groundtruth.mat'

Yao-DD opened this issue · comments

There need to load 'cache_groundtruth.mat' in the file 'loader/imagenet_loader.py ':
def load_val_bbox(label_dict,all_imgs,gt_location):
........
gt_label = sio.loadmat(os.path.join(gt_location,'cache_groundtruth.mat'))
locs = [(x[0].split('/')[-1],x[0],x[1]) for x in all_imgs]
locs.sort()
final_bbox_dict = {}
for i in range(len(locs)):
#gt_label['rec'][:,1][0][0][0], if multilabel then get length, for final eval
final_bbox_dict[locs[i][1]] = gt_label['rec'][:,i][0][0][0][0][1][0]
return final_bbox_dict

But I can not find this file in annotations of Imagenet. How to get it?

Hi, Sorry for the inconvenience.

Actually, the cache_groundtruth.mat is from the CAM baseline.
I've just uploaded a zip file called ImageNet_gt.zip, which includes the cache_groundtruth.mat and the txt file which needs to be used in our code. By the way, you can directly remove the code to read txt files.

Check the archive link I provided in README

Thanks very much!