clovaai / wsolevaluation

Evaluating Weakly Supervised Object Localization Methods Right (CVPR 2020)
MIT License
332 stars 55 forks source link

Heat maps not getting saved in their corresponding locations #3

Closed graylevel255 closed 4 years ago

graylevel255 commented 4 years ago

After training the model, the scoremaps folders are empty! Can you suggest me what might I be missing ?

coallaoh commented 4 years ago

Thank you for your interest in this work!

If you run the main.py code, the heatmaps are not saved. They are directly evaluated on the fly (in memory). This happens at https://github.com/clovaai/wsolevaluation/blob/0c476cd115c21900a734a86cb34a8e92b8b7e278/inference.py#L71.

If you wish to save the heatmaps, save the cam_normalized array in https://github.com/clovaai/wsolevaluation/blob/0c476cd115c21900a734a86cb34a8e92b8b7e278/inference.py#L82

graylevel255 commented 4 years ago

Thank you for your help. However when I run the evaluation code as python evaluation.py --scoremap_root=train_log/CUB_vgg16_CAM/scoremaps/val/ --metadata_root=metadata/CUB/val/ --mask_root=dataset/ --dataset_name=CUB --split=val --cam_curve_interval=0.01 , I get the following error : FileNotFoundError: [Errno 2] No such file or directory: 'train_log/CUB_vgg16_CAM/scoremaps/val/001.Black_footed_Albatross/30107316117.jpg.npy' So does that mean scoremaps need to be saved before running this script ?

coallaoh commented 4 years ago

Yes. The standalone evaluation code assumes saved scoremaps. The train+eval code does not save the scoremaps by default and evaluates them in memory.