jiwoon-ahn / irn

Weakly Supervised Learning of Instance Segmentation with Inter-pixel Relations, CVPR 2019 (Oral)
MIT License
519 stars 100 forks source link

About 'x = x[0] + x[1].flip(-1)' in resnet50_cam.py. #32

Closed username123062 closed 3 years ago

username123062 commented 3 years ago

What is the meaning or function of 'x = x[0] + x[1].flip(-1)' ?

SCoulY commented 3 years ago

Hi @username123062, I had same question about this line, did u figured this out?

chenslcool commented 2 years ago

I think, it corresponding to what VOC12ClassificationDatasetMSF.__get_item__ do to img, matbe a way to generate CAM better

Elaineok commented 2 years ago

x[0] represents the original image, x[1] represents the horizontal flip.

x[1].flip(-1) represents the flipped image will be flipped back again. Multi-scale is often used to obtain better CAM, here is the flip