{"id":15030778,"url":"https://github.com/zhanghang1989/resnest","last_synced_at":"2025-04-10T23:23:44.010Z","repository":{"id":40632014,"uuid":"247528876","full_name":"zhanghang1989/ResNeSt","owner":"zhanghang1989","description":"ResNeSt: Split-Attention Networks","archived":false,"fork":false,"pushed_at":"2022-12-09T10:57:09.000Z","size":390,"stargazers_count":3249,"open_issues_count":61,"forks_count":493,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-03T11:06:18.272Z","etag":null,"topics":["deep-learning","detectron-models","pytorch","resnest","resnet","split-attention-networks"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2004.08955","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhanghang1989.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}},"created_at":"2020-03-15T18:42:11.000Z","updated_at":"2025-03-31T14:17:26.000Z","dependencies_parsed_at":"2023-01-25T16:00:12.339Z","dependency_job_id":null,"html_url":"https://github.com/zhanghang1989/ResNeSt","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FResNeSt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FResNeSt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FResNeSt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FResNeSt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhanghang1989","download_url":"https://codeload.github.com/zhanghang1989/ResNeSt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248313326,"owners_count":21082842,"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":["deep-learning","detectron-models","pytorch","resnest","resnet","split-attention-networks"],"created_at":"2024-09-24T20:14:16.118Z","updated_at":"2025-04-10T23:23:43.990Z","avatar_url":"https://github.com/zhanghang1989.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI](https://img.shields.io/pypi/v/resnest.svg)](https://pypi.python.org/pypi/resnest)\n[![PyPI Pre-release](https://img.shields.io/badge/pypi--prerelease-v0.0.6-ff69b4.svg)](https://pypi.org/project/resnest/#history)\n[![PyPI Nightly](https://github.com/zhanghang1989/ResNeSt/workflows/Pypi%20Nightly/badge.svg)](https://github.com/zhanghang1989/ResNeSt/actions)\n[![Downloads](http://pepy.tech/badge/resnest)](http://pepy.tech/project/resnest)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Unit Test](https://github.com/zhanghang1989/ResNeSt/workflows/Unit%20Test/badge.svg)](https://github.com/zhanghang1989/ResNeSt/actions)\n[![arXiv](http://img.shields.io/badge/cs.CV-arXiv%3A2004.08955-B31B1B.svg)](https://arxiv.org/abs/2004.08955)\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/instance-segmentation-on-coco)](https://paperswithcode.com/sota/instance-segmentation-on-coco?p=resnest-split-attention-networks)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/object-detection-on-coco)](https://paperswithcode.com/sota/object-detection-on-coco?p=resnest-split-attention-networks)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/panoptic-segmentation-on-coco-panoptic)](https://paperswithcode.com/sota/panoptic-segmentation-on-coco-panoptic?p=resnest-split-attention-networks)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/semantic-segmentation-on-ade20k)](https://paperswithcode.com/sota/semantic-segmentation-on-ade20k?p=resnest-split-attention-networks)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/semantic-segmentation-on-cityscapes-val)](https://paperswithcode.com/sota/semantic-segmentation-on-cityscapes-val?p=resnest-split-attention-networks)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/resnest-split-attention-networks/semantic-segmentation-on-pascal-context)](https://paperswithcode.com/sota/semantic-segmentation-on-pascal-context?p=resnest-split-attention-networks)\n\n\n# ResNeSt\nSplit-Attention Network, A New ResNet Variant. It significantly boosts the performance of downstream models such as Mask R-CNN, Cascade R-CNN and DeepLabV3.\n\n![](./miscs/abstract.jpg)\n\n### Table of Contents\n0. [Pretrained Models](#pretrained-models)\n0. [Transfer Learning Models](#transfer-learning-models)\n0. [Verify  ImageNet Results](#verify-imagenet-results)\n0. [How to Train](#how-to-train)\n0. [Reference](#reference)\n\n\n### Pypi / GitHub Install\n\n0. Install this package repo, note that you only need to choose one of the options\n\n```bash\n# using github url\npip install git+https://github.com/zhanghang1989/ResNeSt\n\n# using pypi\npip install resnest --pre\n```\n\n## Pretrained Models\n\n|             | crop size | PyTorch | Gluon |\n|-------------|-----------|---------|-------|\n| ResNeSt-50  | 224       | 81.03   | 81.04 |\n| ResNeSt-101 | 256       | 82.83   | 82.81 |\n| ResNeSt-200 | 320       | 83.84   | 83.88 |\n| ResNeSt-269 | 416       | 84.54   | 84.53 |\n\n- **3rd party implementations** are available: [Tensorflow](https://github.com/QiaoranC/tf_ResNeSt_RegNet_model), [Caffe](https://github.com/NetEase-GameAI/ResNeSt-caffe), [JAX](https://github.com/n2cholas/jax-resnet/).\n\n- Extra ablation study models are available in [link](./ablation.md)\n\n### PyTorch Models\n\n- Load using Torch Hub\n\n```python\nimport torch\n# get list of models\ntorch.hub.list('zhanghang1989/ResNeSt', force_reload=True)\n\n# load pretrained models, using ResNeSt-50 as an example\nnet = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True)\n```\n\n\n- Load using python package\n\n```python\n# using ResNeSt-50 as an example\nfrom resnest.torch import resnest50\nnet = resnest50(pretrained=True)\n```\n\n\n### Gluon Models\n\n- Load pretrained model:\n\n```python\n# using ResNeSt-50 as an example\nfrom resnest.gluon import resnest50\nnet = resnest50(pretrained=True)\n```\n\n## Transfer Learning Models\n\n### Detectron2\n\nWe provide a wrapper for training Detectron2 models with ResNeSt backbone at [d2](./d2). Training configs and pretrained models are released. See details in [d2](./d2).\n\n### MMDetection\n\nThe ResNeSt backbone has been adopted by [MMDetection](https://github.com/open-mmlab/mmdetection/tree/master/configs/resnest).\n\n### Semantic Segmentation\n\n- PyTorch models and training: Please visit [PyTorch Encoding Toolkit](https://hangzhang.org/PyTorch-Encoding/model_zoo/segmentation.html).\n- Gluon models and training: Please visit [GluonCV Toolkit](https://gluon-cv.mxnet.io/model_zoo/segmentation.html#ade20k-dataset).\n\n\n## Verify ImageNet Results:\n\n**Note:** the inference speed reported in the paper are tested using Gluon implementation with RecordIO data.\n\n### Prepare ImageNet dataset:\n\nHere we use raw image data format for simplicity, please follow [GluonCV tutorial](https://gluon-cv.mxnet.io/build/examples_datasets/recordio.html) if you would like to use RecordIO format.\n\n```bash\ncd scripts/dataset/\n# assuming you have downloaded the dataset in the current folder\npython prepare_imagenet.py --download-dir ./\n```\n\n### Torch Model\n\n```bash\n# use resnest50 as an example\ncd scripts/torch/\npython verify.py --model resnest50 --crop-size 224\n```\n\n### Gluon Model\n\n```bash\n# use resnest50 as an example\ncd scripts/gluon/\npython verify.py --model resnest50 --crop-size 224\n```\n\n## How to Train\n\n### ImageNet Models\n\n- Training with MXNet Gluon: Please visit [Gluon folder](./scripts/gluon/).\n- Training with PyTorch: Please visit [PyTorch Encoding Toolkit](https://hangzhang.org/PyTorch-Encoding/model_zoo/imagenet.html) (slightly worse than Gluon implementation).\n\n### Detectron Models\n\nFor object detection and instance segmentation models, please visit our [detectron2-ResNeSt fork](https://github.com/zhanghang1989/detectron2-ResNeSt).\n\n### Semantic Segmentation\n\n- Training with PyTorch: [Encoding Toolkit](https://hangzhang.org/PyTorch-Encoding/model_zoo/segmentation.html).\n- Training with MXNet: [GluonCV Toolkit](https://gluon-cv.mxnet.io/model_zoo/segmentation.html#ade20k-dataset).\n\n## Reference\n\n**ResNeSt: Split-Attention Networks** [[arXiv](https://arxiv.org/pdf/2004.08955.pdf)]\n\nHang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li and Alex Smola\n\n```\n@article{zhang2020resnest,\ntitle={ResNeSt: Split-Attention Networks},\nauthor={Zhang, Hang and Wu, Chongruo and Zhang, Zhongyue and Zhu, Yi and Zhang, Zhi and Lin, Haibin and Sun, Yue and He, Tong and Muller, Jonas and Manmatha, R. and Li, Mu and Smola, Alexander},\njournal={arXiv preprint arXiv:2004.08955},\nyear={2020}\n}\n```\n\n### Major Contributors\n\n- ResNeSt Backbone ([Hang Zhang](https://hangzhang.org/))\n- Detectron Models ([Chongruo Wu](https://github.com/chongruo), [Zhongyue Zhang](http://zhongyuezhang.com/))\n- Semantic Segmentation ([Yi Zhu](https://sites.google.com/view/yizhu/home))\n- Distributed Training ([Haibin Lin](https://sites.google.com/view/haibinlin/))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghang1989%2Fresnest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghang1989%2Fresnest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghang1989%2Fresnest/lists"}