You can use the tool to visualize the feature map of ResNet-50 through Grad-CAM algorithm.
For examples, if your input images are stored on ./images
directory, and the output directory is ./results
.
-
Visualize of ImageNet pretrained weights
python feat_visualization.py --image-dir images --output-dir results --weights-type imagenet
-
Visualize of custom pretrained weights
For example, if we try to visualize the VCLR pretrained weights, assume the weight is stored at
./vclr_torch.pth
.Note, you must transfer the custom weights to torchvision style firstly.
You can refer the README to do it, or download our pretrained model (Download Link).
python feat_visualization.py --image-dir images --output-dir results --weights-type custom --weights-path vclr_torch.pth
Arch | Image | ImageNet | SeCo | VCLR |
---|---|---|---|---|
ResNet-50 |
https://arxiv.org/abs/1610.02391
Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
- other nice visualization tools: