- python==3.8.12
- torch==2.3.0
- mmdet==3.2.0
- lvis
- Tested on CUDA 12.1 and Linux x86_64 system
conda create --name <your_env>
conda activate <your_env>
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia
- Install dependency packages
conda install pandas scipy
pip install opencv-python-headless
pip install lvis
- Install mmcv
pip install -U openmim
mim install mmengine
mim install "mmcv==2.1.0"
- Install MMdet
git clone https://github.com/kostas1515/AGLU.git
cd mmdet
pip install -v -e .
- Create data directory, download COCO 2017 datasets at https://cocodataset.org/#download (2017 Train images [118K/18GB], 2017 Val images [5K/1GB], 2017 Train/Val annotations [241MB]) and extract the zip files:
mkdir data
cd data
wget http://images.cocodataset.org/zips/train2017.zip
wget http://images.cocodataset.org/zips/val2017.zip
#download and unzip LVIS annotations
wget https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_train.json.zip
wget https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_val.json.zip
modify mmdetection/configs/base/datasets/lvis_v1_instance.py and make sure data_root variable points to the above data directory, e.g., data_root = '<user_path>'. For V3DET dataset, download the images from https://github.com/V3Det/V3Det.
To Train on multiple GPUs use tools/dist_train.sh to launch training on multiple GPUs:./tools/dist_train.sh ./configs/<experiment>/<variant.py> <#GPUs>
E.g: To train MaskRCNN SE-R50+AGLU+GOL on LVIS using 8 GPUs use:
./tools/dist_train.sh ./configs/activatios/mask_rcnn_r50_fpn_8x2_sample1e-3_mstrain_lvis_2x.py 8
Be sure to include the APA-AGLU-SE-R50 ImageNet1K pretrained backbone as initialisation. These models are provided in the classification folder.
To test MaskRCNN SE-R50-AGLU+GOL on LVIS use:
./tools/dist_test.sh ./experiments/droploss_normed_mask_se_r50_rfs_4x4_2x_gumbel_uni_se_uniact/droploss_normed_mask_se_r50_rfs_4x4_2x_gumbel_uni_se_uniact.py ./experiments/droploss_normed_mask_se_r50_rfs_4x4_2x_gumbel_uni_se_uniact/epoch_24.pth 8
Method | AP | APr | APc | APf | APb | Model | Output |
---|---|---|---|---|---|---|---|
SE-MaskRCNN-R50-AGLU-APA-GOL | 29.2 | 21.8 | 29.8 | 31.9 | 29.1 | weights | log|config |
SE-MaskRCNN-R101-AGLU-APA-GOL | 30.7 | 23.6 | 31.3 | 33.1 | 31.1 | weights | log|config |
Method | APb | Model | Output |
---|---|---|---|
SE-FasterRCNN-R50-AGLU-APA | 29.9 | weights | log|config |
SE-CascadeRCNN-R50-AGLU-APA | 35.4 | weights | n/a|config |