{"id":21711943,"url":"https://github.com/hrnet/hrnet-maskrcnn-benchmark","last_synced_at":"2025-07-07T06:33:14.603Z","repository":{"id":98122501,"uuid":"187158722","full_name":"HRNet/HRNet-MaskRCNN-Benchmark","owner":"HRNet","description":"Object detection with multi-level representations generated from deep high-resolution representation learning (HRNetV2h).","archived":false,"fork":false,"pushed_at":"2021-10-12T22:58:32.000Z","size":3925,"stargazers_count":139,"open_issues_count":9,"forks_count":35,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T17:49:18.852Z","etag":null,"topics":["faster-rcnn","hrnets","mask-rcnn","object-detection"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HRNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-05-17T06:24:28.000Z","updated_at":"2024-12-22T07:03:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8137be46-ee9f-4881-ad9c-242f1e7c3c69","html_url":"https://github.com/HRNet/HRNet-MaskRCNN-Benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HRNet/HRNet-MaskRCNN-Benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-MaskRCNN-Benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-MaskRCNN-Benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-MaskRCNN-Benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-MaskRCNN-Benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HRNet","download_url":"https://codeload.github.com/HRNet/HRNet-MaskRCNN-Benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HRNet%2FHRNet-MaskRCNN-Benchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264027598,"owners_count":23546105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faster-rcnn","hrnets","mask-rcnn","object-detection"],"created_at":"2024-11-25T23:31:59.791Z","updated_at":"2025-07-07T06:33:14.563Z","avatar_url":"https://github.com/HRNet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HRNet for Object Detection\n\n\n## Introduction\nThis is the official code of [High-Resolution Representations for Object Detection](https://arxiv.org/pdf/1904.04514.pdf). We extend the high-resolution representation (HRNet) [1] 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. The code is based on [maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark)\n\n\u003cdiv align=center\u003e\n\n![](images/hrnetv2p.png)\n\n\u003c/div\u003e\n\n\n## Performance\n\n### ImageNet Pretrained Models\nHRNetV2 ImageNet pretrained models are now available! Codes and pretrained models are in [HRNets for Image Classification](https://github.com/HRNet/HRNet-Image-Classification)\n\nAll models are trained on COCO *train2017* set and evaluated on COCO *val2017* set. Detailed settings or configurations are in [`configs/hrnet`](configs/hrnet).\n\n**Note:** Models are trained with the newly released code and the results have minor differences with that in the paper. \nCurrent results will be updated soon and more models and results are comming.\nAll models are trained on COCO *train2017* set and evaluated on COCO *val2017* set. Detailed settings or configurations are in [`configs/hrnet`](configs/hrnet).\n\n\n### Faster R-CNN\n\n|Backbone|lr sched|mAP|model|\n|:--:|:--:|:--:|:--:|\n| HRNetV2-W18 | 1x | 36.0 | [FasterR-CNN-HR18-1x.pth](https://1drv.ms/u/s!AjfnYvdHLH5Tb3LeGHSr0sODD1w)|\n| HRNetV2-W18 | 2x | 38.4 | [FasterR-CNN-HR18-2x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TcO7N8YfGvZ0Ml0Q)|\n| HRNetV2-W32 | 1x | 39.6 | [FasterR-CNN-HR32-1x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TchNk9JT8VlWkYcI)|\n| HRNetV2-W32 | 2x | 40.9 | [FasterR-CNN-HR32-2x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TbBZscXZo3DKSU74)|\n| HRNetV2-W40 | 1x | 40.4 | [FasterR-CNN-HR40-1x.pth](https://1drv.ms/u/s!AjfnYvdHLH5Tcfwfqrg_9Y8dbPM)|\n| HRNetV2-W40 | 2x | 41.4 | [FasterR-CNN-HR40-2x.pth](https://1drv.ms/u/s!AjfnYvdHLH5Tc4wM4S6SCZMbI8I)|\n| HRNetV2-W48 | 1x | 41.3 | [FasterR-CNN-HR48-1x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TbV9Wna7hJMI1Y8Q)|\n| HRNetV2-W48 | 2x | 41.8 | [FasterR-CNN-HR48-2x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TbpnJXuD_3jL-wsc)|\n\n\n### Faster R-CNN with more training iterations\n\n|Backbone|lr sched|mAP|model|\n|:--:|:--:|:--:|:--:|\n| HRNetV2-W32 | 1x | 39.6 | [FasterR-CNN-HR32-1x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TchNk9JT8VlWkYcI)|\n| HRNetV2-W32 | 2x | 40.9 | [FasterR-CNN-HR32-2x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TbBZscXZo3DKSU74)|\n| HRNetV2-W32 | 3x | 41.4 | [FasterR-CNN-HR32-3x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TeLUahrIPnA60fr8)|\n| HRNetV2-W32 | 4x | 41.6 | [FasterR-CNN-HR32-4x.pth](https://1drv.ms/u/s!AjfnYvdHLH5TeLUahrIPnA60fr8)|\n\nOur HRNets will obtain larger gain when training with more iterations. \n\n## Quick start\n\n#### Install\n\n1. Install PyTorch 1.0 following the [official instructions](https://pytorch.org/)\n\n2. Install `pycocotools`\n````bash\ngit clone https://github.com/cocodataset/cocoapi.git \\\n \u0026\u0026 cd cocoapi/PythonAPI \\\n \u0026\u0026 python setup.py build_ext install \\\n \u0026\u0026 cd ../../\n````\n3. Install `HRNet-MaskRCNN-Benchmark`\n\n````bash\n\ngit clone https://github.com/HRNet/HRNet-MaskRCNN-Benchmark.git\ncd HRNet-MaskRCNN-Benchmark\npython setup.py build develop\npip install -r requirements.txt\n````\n\nfor more details, see [INSTALL.md](INSTALL.md)\n\n\n#### HRNetV2 Pretrained models\n\n```bash\ncd HRNet-MaskRCNN-Benchmark\n# Download pretrained models into this folder\nmkdir hrnetv2_pretrained\n```\n\n#### Train (multi-gpu training)\nPlease specify the configuration file in `configs` (learning rate should be adjusted when the number of GPUs is changed).\n````bash\npython -m torch.distributed.launch --nproc_per_node \u003cGPU NUMS\u003e tools/train_net.py --config-file \u003cCONFIG FILE\u003e\n\n# example (4 gpus)\npython -m torch.distributed.launch --nproc_per_node 4 tools/train_net.py --config-file configs/hrnet/e2e_faster_rcnn_hrnet_w18_1x.yaml\n\n````\n\n#### Test\n\n````bash\npython -m torch.distributed.launch --nproc_per_node \u003cGPU NUMS\u003e tools/test_net.py --config-file \u003cCONFIG-FILE\u003e MODEL.WEIGHT \u003cWEIGHT\u003e\n\n#example (4gpus)\npython -m torch.distributed.launch --nproc_per_node 4 tools/test_net.py --config-file configs/hrnet/e2e_faster_rcnn_hrnet_w18_1x.yaml MODEL.WEIGHT FasterR-CNN-HR18-1x.pth\n\n````\n\n**NOTE:** If you meet some problems, you may find a solution in [issues of official maskrcnn-benchmark](https://github.com/facebookresearch/maskrcnn-benchmark/issues) \n or submit a new issue in our repo.\n\n## Other applications of HRNets (codes and models):\n* [Human pose estimation](https://github.com/leoxiaobin/deep-high-resolution-net.pytorch)\n* [Semantic segmentation](https://github.com/HRNet/HRNet-Semantic-Segmentation)\n* [Facial landmark detection](https://github.com/HRNet/HRNet-Facial-Landmark-Detection)\n* [Image classification](https://github.com/HRNet/HRNet-Image-Classification)\n* [Object detection](https://github.com/HRNet/HRNet-Object-Detection)(based on mmdetection)\n\n## Citation\nIf you find this work or code is helpful in your research, please cite:\n````\n@inproceedings{SunXLW19,\n  title={Deep High-Resolution Representation Learning for Human Pose Estimation},\n  author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},\n  booktitle={CVPR},\n  year={2019}\n}\n\n@article{WangSCJDZLMTWLX19,\n  title={Deep High-Resolution Representation Learning for Visual Recognition},\n  author={Jingdong Wang and Ke Sun and Tianheng Cheng and \n          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and \n          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},\n  journal   = {TPAMI}\n  year={2019}\n}\n````\n\n## Reference\n\n[1] Deep High-Resolution Representation Learning for Visual Recognition. Jingdong Wang, Ke Sun, Tianheng Cheng, \n    Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, Bin Xiao. Accepted by TPAMI.  [download](https://arxiv.org/pdf/1908.07919.pdf)\n\n[2] Cascade R-CNN: Delving into High Quality Object Detection. Zhaowei Cai, and Nuno Vasconcetos. CVPR 2018.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrnet%2Fhrnet-maskrcnn-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrnet%2Fhrnet-maskrcnn-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrnet%2Fhrnet-maskrcnn-benchmark/lists"}