Disclaimer: The team releasing ResNet did not write a model card for this model so this model card has been written by the Hugging Face team.
Model description
ResNet (Residual Network) is a convolutional neural network that democratized the concepts of residual learning and skip connections. This enables to train much deeper models.
This is ResNet v1.5, which differs from the original model: in the bottleneck blocks which require downsampling, v1 has stride = 2 in the first 1x1 convolution, whereas v1.5 has stride = 2 in the 3x3 convolution. This difference makes ResNet50 v1.5 slightly more accurate (~0.5% top1) than v1, but comes with a small performance drawback (~5% imgs/sec) according to
Nvidia
.
Intended uses & limitations
You can use the raw model for image classification. See the
model hub
to look for
fine-tuned versions on a task that interests you.
How to use
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
from transformers import AutoImageProcessor, ResNetForImageClassification
import torch
from datasets import load_dataset
dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]
processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = ResNetForImageClassification.from_pretrained("microsoft/resnet-50")
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
# model predicts one of the 1000 ImageNet classes
predicted_label = logits.argmax(-1).item()
print(model.config.id2label[predicted_label])
@inproceedings{he2016deep,
title={Deep residual learning for image recognition},
author={He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
pages={770--778},
year={2016}
}
Runs of microsoft resnet-50 on huggingface.co
277.0M
Total runs
6.3M
24-hour runs
30.4M
3-day runs
54.2M
7-day runs
193.0M
30-day runs
More Information About resnet-50 huggingface.co Model
resnet-50 huggingface.co is an AI model on huggingface.co that provides resnet-50's model effect (), which can be used instantly with this microsoft resnet-50 model. huggingface.co supports a free trial of the resnet-50 model, and also provides paid use of the resnet-50. Support call resnet-50 model through api, including Node.js, Python, http.
resnet-50 huggingface.co is an online trial and call api platform, which integrates resnet-50's modeling effects, including api services, and provides a free online trial of resnet-50, you can try resnet-50 online for free by clicking the link below.
microsoft resnet-50 online free url in huggingface.co:
resnet-50 is an open source model from GitHub that offers a free installation service, and any user can find resnet-50 on GitHub to install. At the same time, huggingface.co provides the effect of resnet-50 install, users can directly use resnet-50 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.