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 AutoFeatureExtractor, ResNetForImageClassification
import torch
from datasets import load_dataset
dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]
feature_extractor = AutoFeatureExtractor.from_pretrained("microsoft/resnet-152")
model = ResNetForImageClassification.from_pretrained("microsoft/resnet-152")
inputs = feature_extractor(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-152 on huggingface.co
10.6K
Total runs
213
24-hour runs
730
3-day runs
1.5K
7-day runs
6.6K
30-day runs
More Information About resnet-152 huggingface.co Model
resnet-152 huggingface.co is an AI model on huggingface.co that provides resnet-152's model effect (), which can be used instantly with this microsoft resnet-152 model. huggingface.co supports a free trial of the resnet-152 model, and also provides paid use of the resnet-152. Support call resnet-152 model through api, including Node.js, Python, http.
resnet-152 huggingface.co is an online trial and call api platform, which integrates resnet-152's modeling effects, including api services, and provides a free online trial of resnet-152, you can try resnet-152 online for free by clicking the link below.
microsoft resnet-152 online free url in huggingface.co:
resnet-152 is an open source model from GitHub that offers a free installation service, and any user can find resnet-152 on GitHub to install. At the same time, huggingface.co provides the effect of resnet-152 install, users can directly use resnet-152 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.