Retour au classement

HRNet/HRNet-Image-Classification

Pythonjingdongwang2017.github.io/Projects/HRNet/

Train the HRNet model on ImageNet

image-classificationimagenethrnetshigh-resolution-net
Croissance des étoiles
Étoiles
1.1k
Forks
219
Croissance hebdomadaire
Issues
31
5001k
avr. 2019sept. 2021févr. 2024juil. 2026
ArtefactsPyPIpip install hrnet-image-classification
README

High-resolution networks (HRNets) for Image classification

News

Introduction

This is the official code of high-resolution representations for ImageNet classification. We augment the HRNet with a classification head shown in the figure below. First, the four-resolution feature maps are fed into a bottleneck and the number of output channels are increased to 128, 256, 512, and 1024, respectively. Then, we downsample the high-resolution representations by a 2-strided 3x3 convolution outputting 256 channels and add them to the representations of the second-high-resolution representations. This process is repeated two times to get 1024 channels over the small resolution. Last, we transform 1024 channels to 2048 channels through a 1x1 convolution, followed by a global average pooling operation. The output 2048-dimensional representation is fed into the classifier.

ImageNet pretrained models

HRNetV2 ImageNet pretrained models are now available!

model #Params GFLOPs top-1 error top-5 error Link
HRNet-W18-C-Small-v1 13.2M 1.49 27.7% 9.3% OneDrive/BaiduYun(Access Code:v3sw)
HRNet-W18-C-Small-v2 15.6M 2.42 24.9% 7.6% OneDrive/BaiduYun(Access Code:bnc9)
HRNet-W18-C 21.3M 3.99 23.2% 6.6% OneDrive/BaiduYun(Access Code:r5xn)
HRNet-W30-C 37.7M 7.55 21.8% 5.8% OneDrive/BaiduYun(Access Code:ajc1)
HRNet-W32-C 41.2M 8.31 21.5% 5.8% OneDrive/BaiduYun(Access Code:itc1)
HRNet-W40-C 57.6M 11.8 21.1% 5.5% OneDrive/BaiduYun(Access Code:i58x)
HRNet-W44-C 67.1M 13.9 21.1% 5.6% OneDrive/BaiduYun(Access Code:3imd)
HRNet-W48-C 77.5M 16.1 20.7% 5.5% OneDrive/BaiduYun(Access Code:68g2)
HRNet-W64-C 128.1M 26.9 20.5% 5.4% OneDrive/BaiduYun(Access Code:6kw4)

Newly added checkpoints:

model #Params GFLOPs top-1 error Link
HRNet-W18-C (w/ CosineLR + CutMix + 300epochs) 21.3M 3.99 22.1% Link
HRNet-W48-C (w/ CosineLR + CutMix + 300epochs) 77.5M 16.1 18.9% Link
HRNet-W18-C-ssld (converted from PaddlePaddle) 21.3M 3.99 18.8% Link
HRNet-W48-C-ssld (converted from PaddlePaddle) 77.5M 16.1 16.4% Link

In the above Table, the first 2 checkpoints are trained with CosineLR, CutMix data augmentation and for longer epochs, i.e., 300epochs. The other two checkpoints are converted from PaddleClas. Please refer to SSLD tutorial for more details.

Quick start

Install

  1. Install PyTorch=0.4.1 following the official instructions
  2. git clone https://github.com/HRNet/HRNet-Image-Classification
  3. Install dependencies: pip install -r requirements.txt

Data preparation

You can follow the Pytorch implementation: https://github.com/pytorch/examples/tree/master/imagenet

The data should be under ./data/imagenet/images/.

Train and test

Please specify the configuration file.

For example, train the HRNet-W18 on ImageNet with a batch size of 128 on 4 GPUs:

python tools/train.py --cfg experiments/cls_hrnet_w18_sgd_lr5e-2_wd1e-4_bs32_x100.yaml

For example, test the HRNet-W18 on ImageNet on 4 GPUs:

python tools/valid.py --cfg experiments/cls_hrnet_w18_sgd_lr5e-2_wd1e-4_bs32_x100.yaml --testModel hrnetv2_w18_imagenet_pretrained.pth

Other applications of HRNet

Citation

If you find this work or code is helpful in your research, please cite:

@inproceedings{SunXLW19,
  title={Deep High-Resolution Representation Learning for Human Pose Estimation},
  author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},
  booktitle={CVPR},
  year={2019}
}

@article{WangSCJDZLMTWLX19,
  title={Deep High-Resolution Representation Learning for Visual Recognition},
  author={Jingdong Wang and Ke Sun and Tianheng Cheng and 
          Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and 
          Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},
  journal   = {TPAMI}
  year={2019}
}

Reference

[1] Deep High-Resolution Representation Learning for Visual Recognition. Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, Bin Xiao. Accepted by TPAMI. download

Dépôts similaires
ultralytics/ultralytics

Ultralytics YOLO26, YOLO11, YOLOv8 — object detection, instance segmentation, semantic segmentation, image classification, pose estimation, object tracking

PythonPyPIGNU Affero General Public License v3.0ultralyticsyolov8
platform.ultralytics.com
59.7k11.4k
ultralytics/yolov5

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.

PythonPyPIGNU Affero General Public License v3.0yolov5object-detection
docs.ultralytics.com/yolov5/
57.7k17.5k
huggingface/pytorch-image-models

The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more

PythonPyPIApache License 2.0pytorchresnet
huggingface.co/docs/timm
37k5.2k
HumanSignal/label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format

TypeScriptnpmApache License 2.0computer-visiondeep-learning
labelstud.io
27.9k3.6k
lucidrains/vit-pytorch

Implementation of Vision Transformer, a simple way to achieve SOTA in vision classification with only a single transformer encoder, in Pytorch

PythonPyPIMIT Licenseartificial-intelligenceattention-mechanism
25.4k3.5k
HumanSignal/labelImg

LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Label Studio, the open source data labeling tool for images, text, hypertext, audio, video and time-series data.

PythonPyPIMIT Licensepython2python3
youtu.be/p0nR2YsCY_U
25.1k6.6k
cvat-ai/cvat

Computer Vision Annotation Tool (CVAT) is a leading platform for building high-quality visual datasets for vision AI. It offers open-source, cloud, and enterprise products, as well as labeling services, for image, video, and 3D annotation with AI-assisted labeling, quality assurance, team collaboration, analytics, and developer APIs.

PythonPyPIMIT Licensevideo-annotationcomputer-vision
cvat.ai
16.4k3.8k
microsoft/Swin-Transformer

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows".

PythonPyPIMIT Licenseswin-transformerimage-classification
arxiv.org/abs/2103.14030
16k2.2k
albumentations-team/albumentations

Fast and flexible image augmentation library. Paper about the library: https://www.mdpi.com/2078-2489/11/2/125

PythonPyPIMIT Licenseimage-augmentationmachine-learning
albumentations.ai
15.3k1.7k
jacobgil/pytorch-grad-cam

Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.

PythonPyPIMIT Licensedeep-learningpytorch
jacobgil.github.io/pytorch-gradcam-book
12.9k1.7k
chenyuntc/pytorch-book

PyTorch tutorials and fun projects including neural talk, neural style, poem writing, anime generation (《深度学习框架PyTorch:入门与实战》)

Jupyter NotebookMIT Licensepytorchpytorch-tutorials
12.8k3.7k
extreme-assistant/CVPR2024-Paper-Code-Interpretation

cvpr2024/cvpr2023/cvpr2022/cvpr2021/cvpr2020/cvpr2019/cvpr2018/cvpr2017 论文/代码/解读/直播合集,极市团队整理

computer-visioncvpr2020
bbs.cvmart.net
12.5k2.2k