- Our codes are based on MMDetection-2.x. Please follow the installation of MMDetection and make sure you can run it successfully.
- This repo uses mmdet==2.25.3 and mmcv-full==1.7.0
- install grad-cam by:
pip install grad-cam
- 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/, use filter_traffic.py to get coco-traffic dataset.
- Unzip KITTI dataset into data/kitti/ (We group classes as 3 and split orignal training set into 8:2 as training and validation sets)
#single GPU
python tools/train.py configs/distillers/gkd/gkd_faster_rcnn_r50_r101_fpn_1x_coco.py
#multi GPU
bash tools/dist_train.sh configs/distillers/gkd/gkd_faster_rcnn_r50_r101_fpn_1x_coco.py 8
# Tansfer the FGD model into mmdet model
python pth_transfer.py --fgd_path $fgd_ckpt --output_path $new_mmdet_ckpt
#single GPU
python tools/test.py configs/distillers/gkd/gkd_faster_rcnn_r50_r101_fpn_1x_coco.py $new_mmdet_ckpt --eval bbox
#multi GPU
bash tools/dist_test.sh configs/distillers/gkd/gkd_faster_rcnn_r50_r101_fpn_1x_coco.py $new_mmdet_ckpt 8 --eval bbox
@inproceedings{lan2024gradient,
title={Gradient-guided knowledge distillation for object detectors},
author={Lan, Qizhen and Tian, Qing},
booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
pages={424--433},
year={2024}
}
Our code is based on the project MMDetection.
Thanks to the work FGD and pytorch-grad-cam.