This is an pytorch implementation of the WACV'2020 paper 'Improving Object Detection with Inverted Attention'.
Create a conda environment and install dependencies:
conda create -y -n torch113 python=3.8
conda activate torch113
pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu117
pip install -r requirements.txt
We use Pascal VOC2012 train/val dataset
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
tar -xvf OCtrainval_11-May-2012.tar
Set the dataset path "--data-path" of VOCdevkit in the 'train_res50_fpn.py'
python train_res50_fpn.py
python validation.py
Change the model path in the "Object_CAM_IAN.ipynb" under visualization file, and you will obtain the attention map like this:
This repo benefits from faster_rcnn,and Pytorch-Inverted-Attention. Thanks for their works.