FGD
Paper: Focal and Global Knowledge Distillation for Detectors
Install MMDetection and MS COCO2017
- Our codes are based on MMDetection. Please follow the installation of MMDetection and make sure you can run it successfully.
- This repo uses mmdet==2.11.0 and mmcv-full==1.2.4
Add and Replace the codes
- Add the configs/. in our codes to the configs/ in mmdetectin's codes.
- Add the mmdet/distillation/. in our codes to the mmdet/ in mmdetectin's codes.
- Replace the mmdet/apis/train.py and tools/train.py in mmdetection's codes with mmdet/apis/train.py and tools/train.py in our codes.
- Add pth_transfer.py to mmdetection's codes.
- Unzip COCO dataset into data/coco/
Train
#single GPU
python tools/train.py configs/distillers/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py
#multi GPU
bash tools/dist_train.sh configs/distillers/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py 8
Transfer
# Tansfer the FGD model into mmdet model
python pth_transfer.py --fgd_path $fgd_ckpt --output_path $new_mmdet_ckpt
Test
#single GPU
python tools/test.py configs/retinanet/retinanet_r50_fpn_2x_coco.py $new_mmdet_ckpt --eval bbox
#multi GPU
bash tools/dist_test.sh configs/retinanet/retinanet_r50_fpn_2x_coco.py $new_mmdet_ckpt 8 --eval bbox
Results
Model | Backbone | mAP | config | weight | code |
---|---|---|---|---|---|
RetinaNet | ResNet-50 | 40.7 | config | baidu | wsfw |
RetinaNet | ResNet-101 | 41.7 | config | ||
Faster RCNN | ResNet-50 | 42.0 | config | baidu | dgpf |
Faster RCNN | ResNet-101 | 44.1 | config | ||
RepPoints | ResNet-50 | 42.0 | config | baidu | qx5d |
RepPoints | ResNet-101 | 43.8 | config | ||
FCOS | ResNet-50 | 42.7 | config | baidu | sedt |
MaskRCNN | ResNet-50 | 42.1 | config | baidu | sv8m |
Acknowledgement
Our code is based on the project MMDetection.
Thanks to the work GCNet and mmetection-distiller.