Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Dynamic Head

By Lin Song, Yanwei Li, Zhengkai Jiang, Zeming Li, Hongbin Sun, Jian Sun, Nanning Zheng.

This repo is an official implementation for "Fine-Grained Dynamic Head for Object Detection" (NeurIPS2020) on PyTorch framework.

introduce image



  • Python >= 3.6
  • PyTorch >= 1.6 and torchvision
  • OpenCV, needed by demo and visualization
  • pycocotools:
    • pip install cython
    • pip install 'git+'
  • prodict:
    • pip install prodict
  • GCC >= 4.9

Build from source

  • git clone
  • cd DynamicHead
  • python build develop

Prepare data

See datasets/


All the projects are placed in cvpods_playground. You need to select a project and enter the corresponding folder.

# For example
cd cvpods_playground/fcos.res50.1x


# Running training procedure with specific GPU number
cvpods_train --gpu-nums <GPU_NUM> [optional arguments]

# Please refer to tools/ for more optional arguments


# Running inference procedure with specific GPU number
# The program will load the lastest model weights from ./log folder
cvpods_test --gpu-nums <GPU_NUM> [optional arguments]

# Running inference procedure with specific GPU number and model path
cvpods_test --gpu-nums <GPU_NUM> MODEL.WEIGHTS <model_path> [optional arguments]

# Please refer to tools/ for more optional arguments

Visualize your image [Optional]

# Please refer to demo/ for more optional arguments
python ../../demo/ --config <config_path> --input <input_path> --output <output_path> MODEL.WEIGHTS <model_path> [optional arguments]


Object Detection on COCO val set

All the results are based on ResNet-50 backbone. The FLOPs are calculated on the head only. "Low", "Mid" and "High" correspond to three configurations of different computational complex.

Method Depth APbox (%) FLOPsavg FLOPsmin FLOPsmax Project Model
FCOS D2 38.7 98.0 98.0 98.0 Link GoogleDrive
FCOS+Fix D4 40.1 198.6 198.6 198.6 Link GoogleDrive
FCOS+Fix D8 39.3 397.2 397.2 397.2 Link GoogleDrive
FCOS+Dynamic (Mid) D4 40.7 52.2 12.1 144.4 Link GoogleDrive
FCOS+Dynamic (Low) D8 40.2 33.3 6.4 140.2 Link GoogleDrive
FCOS+Dynamic (Mid) D8 41.2 83.9 21.3 237.7 Link GoogleDrive
FCOS+Dynamic (High) D8 42.0 277.5 180.4 328.5 Link GoogleDrive

More Results is Coming

To do

  • Easier installation based on pip
  • Fast implementation for masked convolution
  • Application on two-stage object detectors


Please cite the paper in your publications if it helps your research.

    title = {Fine-Grained Dynamic Head for Object Detection},
    author = {Song, Lin and Li, Yanwei and Jiang, Zhengkai and Li, Zeming and Sun, Hongbin and Sun, Jian and Zheng, Nanning},
    booktitle = {Advances in Neural Information Processing Systems},
    year = {2020}

Please cite this project in your publications if it helps your research.

    author = {Song, Lin},
    title = {DynamicHead},
    howpublished = {\url{}},
    year ={2020}


No description, website, or topics provided.




No releases published


No packages published