• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    Python
  • License
    Other
  • Created over 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

High-resolution Networks for the Fully Convolutional One-Stage Object Detection (FCOS) algorithm

High-resolution Networks for FCOS

Introduction

This project contains the code of HRNet-FCOS, i.e., using High-resolution Networks (HRNets) as the backbones for the Fully Convolutional One-Stage Object Detection (FCOS) algorithm, which achieves much better object detection performance compared with the ResNet-FCOS counterparts while keeping a similar computation complexity. For more projects using HRNets, please go to our website.

Quick start

Installation

Please check INSTALL.md for installation instructions. You may also want to see the original README.md of FCOS.

Inference

The inference command line on coco minival split:

python tools/test_net.py \
    --config-file configs/fcos/fcos_hrnet_w32_5l_2x.yaml \
    MODEL.WEIGHT models/FCOS_hrnet_w32_5l_2x.pth \
    TEST.IMS_PER_BATCH 8

Please note that:

  1. If your model's name is different, please replace models/FCOS_hrnet_w32_5l_2x.pth with your own.
  2. If you enounter out-of-memory error, please try to reduce TEST.IMS_PER_BATCH to 1.
  3. If you want to evaluate a different model, please change --config-file to its config file (in configs/fcos) and MODEL.WEIGHT to its weights file.

For your convenience, we provide the following trained models.

FCOS Model Training mem (GB) Multi-scale training SyncBN Testing time / im # params GFLOPs AP (minival) Link
ResNet_50_5l_2x 29.3 No No 71ms 32.0M 190.0 37.1 -
HRNet_W18_5l_2x 54.4 No No 72ms 17.5M 180.3 37.7 model
HRNet_W18_5l_2x 55.0 Yes Yes 72ms 17.5M 180.3 39.4 model
ResNet_50_6l_2x 58.2 No No 98ms 32.7M 529.0 37.1 -
HRNet_W18_6l_2x 88.1 No No 106ms 18.1M 515.1 37.8 model
ResNet_101_5l_2x 44.1 Yes No 74ms 51.0M 261.2 41.4 model
HRNet_W32_5l_2x 78.9 Yes No 87ms 37.3M 273.3 41.9 model
HRNet_W32_5l_2x 80.1 Yes Yes 87ms 37.3M 273.3 42.5 model
ResNet_101_6l_2x 71.0 Yes No 121ms 51.6M 601.0 41.5 model
HRNet_W32_6l_2x 108.6 Yes No 125ms 37.9M 608.0 42.1 model
HRNet_W32_6l_2x 109.9 Yes Yes 125ms 37.9M 608.0 42.9 model
HRNet_W40_6l_3x 128.0 Yes No 142ms 54.1M 682.9 42.6 model

[1] 1x, 2x and 3x mean the model is trained for 90K, 180K and 270k iterations, respectively.
[2] 5l and 6l denote that we use feature pyramid with 5 levels and 6 levels, respectively.
[3] We provide model trained with Synchronous Batch Normalization (SyncBN).
[4] We report total training memory footprint on all GPUs instead of the memory footprint per GPU as in maskrcnn-benchmark.
[5] The inference speed of HRNet can get improved if the branches in the HRNet model can run in parallel.
[6] All results are obtained with a single model and without any test time data augmentation.

Training

The following command line will trains a fcos_hrnet_w32_5l_2x model on 8 GPUs with Synchronous Stochastic Gradient Descent (SGD):

python -m torch.distributed.launch \
    --nproc_per_node=8 \
    --master_port=$((RANDOM + 10000)) \
    tools/train_net.py \
    --config-file configs/fcos/fcos_hrnet_w32_5l_2x.yaml \
    MODEL.WEIGHT hrnetv2_w32_imagenet_pretrained.pth \
    MODEL.SYNCBN False \
    DATALOADER.NUM_WORKERS 4 \
    OUTPUT_DIR training_dir/fcos_hrnet_w32_5l_2x

Note that:

  1. If you want to use fewer GPUs, please change --nproc_per_node to the number of GPUs. No other settings need to be changed. The total batch size does not depends on nproc_per_node. If you want to change the total batch size, please change SOLVER.IMS_PER_BATCH in configs/fcos/fcos_hrnet_w32_5l_2x.yaml.
  2. If you want to use Synchronous Batch-Normalization (SyncBN), please change MODEL.SYNCBN to True. Note that this will lead to ~2x slower training speed when training on mulitple machines. You also need to fix the image padding size when using SyncBN, see here.
  3. The imagenet pre-trained model can be found here.
  4. The models will be saved into OUTPUT_DIR.
  5. If you want to train FCOS on your own dataset, please follow this instruction #54.

Contributing to the project

Any pull requests or issues are welcome.

Citations

Please consider citing the following papers in your publications if the project helps your research.

@article{sun2019deep,
  title={Deep High-Resolution Representation Learning for Human Pose Estimation},
  author={Sun, Ke and Xiao, Bin and Liu, Dong and Wang, Jingdong},
  journal={arXiv preprint arXiv:1902.09212},
  year={2019}
}

@article{tian2019fcos,
  title   =  {{FCOS}: Fully Convolutional One-Stage Object Detection},
  author  =  {Tian, Zhi and Shen, Chunhua and Chen, Hao and He, Tong},
  journal =  {arXiv preprint arXiv:1904.01355},
  year    =  {2019}
}

License

For academic use, this project is licensed under the 2-clause BSD License - see the LICENSE file for details. For commercial use, please contact the authors.

More Repositories

1

HRNet-Semantic-Segmentation

The OCR approach is rephrased as Segmentation Transformer: https://arxiv.org/abs/1909.11065. This is an official implementation of semantic segmentation for HRNet. https://arxiv.org/abs/1908.07919
Python
3,131
star
2

HigherHRNet-Human-Pose-Estimation

This is an official implementation of our CVPR 2020 paper "HigherHRNet: Scale-Aware Representation Learning for Bottom-Up Human Pose Estimation" (https://arxiv.org/abs/1908.10357)
Python
1,330
star
3

HRNet-Facial-Landmark-Detection

This is an official implementation of facial landmark detection for our TPAMI paper "Deep High-Resolution Representation Learning for Visual Recognition". https://arxiv.org/abs/1908.07919
Python
1,046
star
4

HRNet-Image-Classification

Train the HRNet model on ImageNet
Python
964
star
5

Lite-HRNet

This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution Network.
Python
826
star
6

HRFormer

[ NeurIPS2021] This is an official implementation of our paper "HRFormer: High-Resolution Transformer for Dense Prediction".
Python
486
star
7

DEKR

This is an official implementation of our CVPR 2021 paper "Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression" (https://arxiv.org/abs/2104.02300)
Python
437
star
8

HRNet-Human-Pose-Estimation

This repo is copied from https://github.com/leoxiaobin/deep-high-resolution-net.pytorch
Cuda
250
star
9

HRNet-Bottom-Up-Pose-Estimation

This is an official pytorch implementation of โ€œBottom-Up Human Pose Estimation by Ranking Heatmap-Guided Adaptive Keypoint Estimatesโ€ (https://arxiv.org/abs/2006.15480).
Python
146
star
10

HRNet-MaskRCNN-Benchmark

Object detection with multi-level representations generated from deep high-resolution representation learning (HRNetV2h).
Python
138
star
11

HRNet-Applications-Collection

A collection of HRNet applications (Please feel freely add your applications if not included)
25
star