Closed hshustc closed 7 years ago
Take a look at https://github.com/metalbubble/CAM/blob/master/prepare_image.m, the 224x224 crops are generated from the original 256x256 image, so in the mergeTenCrop, it will merge the 10 crops back to the 256x256 image, following the same sampling coordinates in the prepare_image.m
Yes, I have seen that code. Each heatmap corresponds to a 224*224
area of the original input image (256-256
). However, the indices
in mergeTenCrop.m is actually [1, 1]
, as a result of which, the output alignImgMean
is simply the mean of 10 heatmaps. By contrast, in prepare_image.m', the
indices` is [1,33].
Oh, there was a error in the demo.m. I just fixed it, now it could correctly merge the ten crops. Thanks a lot for reporting the error, @hshustc !
You are welcome. Thanks for sharing the code, which helps me a lot. @metalbubble
As far as I can see, the size of heatmap for each testing image should be 224-224. So in mergeTenCrop.m, the size of input, i.e. CAMmap_crops, is expected to be 224-224-10, not 256-256-10. And the size of cropImgSet should also be changed to 224-224-3-10.