This is the official code of High-Resolution Representations for Object Detection. We extend the high-resolution representation (HRNet) by augmenting the high-resolution representation by aggregating the (upsampled) representations from all the parallel convolutions, leading to stronger representations. We build a multi-level representation from the high resolution and apply it to the Faster R-CNN, Mask R-CNN and Cascade R-CNN framework. This proposed approach achieves superior results to existing single-model networks on COCO object detection.



ImageNet pretrained models

HRNetV2 ImageNet pretrained models are now available! Codes and pretrained models are in HRNets for Image Classification

All models are trained on COCO train2017 set and evaluated on COCO val2017 set. Detailed settings or configurations are in configs/hrnet.

Note: Models are trained with the newly released code and the results have minor differences with that in the paper.
Current results will be updated soon and more models and results are comming.

Quick start


This code is developed using on Python 3.6 and PyTorch 1.0.0 on Ubuntu 16.04 with NVIDIA GPUs. Training and testing are
performed using 4 NVIDIA P100 GPUs with CUDA 9.0 and cuDNN 7.0. Other platforms or GPUs are not fully tested.


  1. Install PyTorch 1.0 following the official instructions
  2. Install mmcv
pip install mmcv
  1. Install pycocotools
git clone \
 && cd cocoapi/PythonAPI \
 && python build_ext install \
 && cd ../../
  1. Install mmdetection-hrnet
git clone

cd mmdetection-hrnet
# compile CUDA extensions.
chmod +x

# run setup
python install 

# or install locally
python install --user

For more details, see

HRNetV2 pretrained models

cd mmdetection-hrnet
# Download pretrained models into this folder
mkdir hrnetv2_pretrained


Please download the COCO dataset from cocodataset. If you use zip format, please specify CocoZipDataset in config files or CocoDataset if you unzip the downloaded dataset.

Train (multi-gpu training)

Please specify the configuration file in configs (learning rate should be adjusted when the number of GPUs is changed).

python -m torch.distributed.launch --nproc_per_node <GPUS NUM> tools/ <CONFIG-FILE> --launcher pytorch
# example:
python -m torch.distributed.launch --nproc_per_node 4 tools/ configs/hrnet/ --launcher pytorch


python tools/ <CONFIG-FILE> <MODEL WEIGHT> --gpus <GPUS NUM> --eval bbox --out result.pkl
# example:
python tools/ configs/hrnet/ work_dirs/faster_rcnn_hrnetv2p_w18_1x/model_final.pth --gpus 4 --eval bbox --out result.pkl