Giter Club home page Giter Club logo

fgd's Introduction

FGD

CVPR 2022 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
  • If you want to use higher mmdet version, you may have to change the optimizer in apis/train.py and build_detector in tools/train.py.
  • For mmdet>=2.12.0, if you want to use inheriting strategy, you have to initalize the student with teacher's parameters after model.init_weights().

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 Baseline(mAP) +FGD(mAP) config weight code
RetinaNet ResNet-50 37.4 40.7 config baidu wsfw
RetinaNet ResNet-101 38.9 41.7 config
Faster RCNN ResNet-50 38.4 42.0 config baidu dgpf
Faster RCNN ResNet-101 39.8 44.1 config
RepPoints ResNet-50 38.6 42.0 config baidu qx5d
RepPoints ResNet-101 40.5 43.8 config
FCOS ResNet-50 38.5 42.7 config baidu sedt
MaskRCNN ResNet-50 39.2 42.1 config baidu sv8m
GFL ResNet-50 40.2 43.5 config
Model Backbone Baseline(Mask mAP) +FGD(Mask mAP) config weight code
SOLO ResNet-50 33.1 36.0 config
MaskRCNN ResNet-50 35.4 37.8 config baidu sv8m

Citation

@article{yang2021focal,
  title={Focal and Global Knowledge Distillation for Detectors},
  author={Yang, Zhendong and Li, Zhe and Jiang, Xiaohu and Gong, Yuan and Yuan, Zehuan and Zhao, Danpei and Yuan, Chun},
  journal={arXiv preprint arXiv:2111.11837},
  year={2021}
}

Acknowledgement

Our code is based on the project MMDetection.

Thanks to the work GCNet and mmetection-distiller.

fgd's People

Contributors

yzd-v avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.