Skip to main content

ResNeSt

Project description

PyPI PyPI Pre-release PyPI Nightly Downloads License Unit Test arXiv

PWC PWC PWC PWC PWC PWC

ResNeSt

Split-Attention Network, A New ResNet Variant. It significantly boosts the performance of downstream models such as Mask R-CNN, Cascade R-CNN and DeepLabV3.

Table of Contents

  1. Pretrained Models
  2. Transfer Learning Models
  3. Verify ImageNet Results
  4. How to Train
  5. Reference

Pypi / GitHub Install

  1. Install this package repo, note that you only need to choose one of the options
# using github url
pip install git+https://github.com/zhanghang1989/ResNeSt

# using pypi
pip install resnest --pre

Pretrained Models

crop size PyTorch Gluon
ResNeSt-50 224 81.03 81.04
ResNeSt-101 256 82.83 82.81
ResNeSt-200 320 83.84 83.88
ResNeSt-269 416 84.54 84.53
  • 3rd party implementations are available: Tensorflow, Caffe, JAX.

  • Extra ablation study models are available in link

PyTorch Models

  • Load using Torch Hub
import torch
# get list of models
torch.hub.list('zhanghang1989/ResNeSt', force_reload=True)

# load pretrained models, using ResNeSt-50 as an example
net = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True)
  • Load using python package
# using ResNeSt-50 as an example
from resnest.torch import resnest50
net = resnest50(pretrained=True)

Gluon Models

  • Load pretrained model:
# using ResNeSt-50 as an example
from resnest.gluon import resnest50
net = resnest50(pretrained=True)

Transfer Learning Models

Detectron2

We provide a wrapper for training Detectron2 models with ResNeSt backbone at d2. Training configs and pretrained models are released. See details in d2.

MMDetection

The ResNeSt backbone has been adopted by MMDetection.

Semantic Segmentation

Verify ImageNet Results:

Note: the inference speed reported in the paper are tested using Gluon implementation with RecordIO data.

Prepare ImageNet dataset:

Here we use raw image data format for simplicity, please follow GluonCV tutorial if you would like to use RecordIO format.

cd scripts/dataset/
# assuming you have downloaded the dataset in the current folder
python prepare_imagenet.py --download-dir ./

Torch Model

# use resnest50 as an example
cd scripts/torch/
python verify.py --model resnest50 --crop-size 224

Gluon Model

# use resnest50 as an example
cd scripts/gluon/
python verify.py --model resnest50 --crop-size 224

How to Train

ImageNet Models

Detectron Models

For object detection and instance segmentation models, please visit our detectron2-ResNeSt fork.

Semantic Segmentation

Reference

ResNeSt: Split-Attention Networks [arXiv]

Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Zhi Zhang, Haibin Lin, Yue Sun, Tong He, Jonas Muller, R. Manmatha, Mu Li and Alex Smola

@article{zhang2020resnest,
title={ResNeSt: Split-Attention Networks},
author={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},
journal={arXiv preprint arXiv:2004.08955},
year={2020}
}

Major Contributors

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resnest-0.0.6b20220217.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

resnest-0.0.6b20220217-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file resnest-0.0.6b20220217.tar.gz.

File metadata

  • Download URL: resnest-0.0.6b20220217.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for resnest-0.0.6b20220217.tar.gz
Algorithm Hash digest
SHA256 b9351c43979c778c1cff2274bc55a8dbfc978bb864d6371da9c9ec38eba8cbf5
MD5 87aeda2c62c6c85bdc38d76a49d27c4a
BLAKE2b-256 3fa8c687d18aecd8cfd3501d82c15fb6c9ca12492c0fbe4106bb375795aa3bd6

See more details on using hashes here.

File details

Details for the file resnest-0.0.6b20220217-py3-none-any.whl.

File metadata

  • Download URL: resnest-0.0.6b20220217-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for resnest-0.0.6b20220217-py3-none-any.whl
Algorithm Hash digest
SHA256 088c9fba4f086291a173c3282793b57d344f526017847e38d2fb4754da96c6b8
MD5 6e3d5e5143dabc103d7b064ea6fe49fa
BLAKE2b-256 5e89b31cdf207375d4d7c53b2166654e2b988741c316beebc606e6c8149c2ed6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page