PyTorch implementation of "Learning Deep Features for Discriminative Localization"
Unofficial Pytorch Implementation of ‘Learning Deep Features for Discriminative Localization’
Reference: Learning Deep Features for Discriminative Localization, CVPR2016
I used the Networks that trained ImageNet data from torchvision.models
.
--gpu-no
: Number of gpu device (-1: cpu, 0~n: gpu)--network
: Network for backbone (Possible networks: resnet50, resnext50_32x4d, wide_resnet50_2, googlenet, densenet161, inception_v3, shufflenet_v2_x1_0, mobilenet_v2, mnasnet1_0)--image
: Input image path--topk
: Create k Class Activation Maps (CAMs) with the highest probability--imsize
: Size to resize image (maintaining aspect ratio)--cropsize
: Size to crop cetenr region--blend-alpha
: Interpolation factor to overlay the input with CAM --save-path
: Path to save outputspython cam.py --image imgs/input/img1.jpg --topk 3 --imsize 256 --network resnet50