Downloads · 30 days
5
1% of all-time downloads
Charles95/openvino_resnet50
openvino_resnet50 is a image classification model from Charles95. Use it when you need a label for an image. It is set up for openvino. The card lists the license as apache-2.0.
ResNet model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper Deep Residual Learning for Image Recognition by He et al.
Downloads · 30 days
5
1% of all-time downloads
All-time downloads
557
Public
Repo size
102 MB
Likes
1
Public
Click a slice to open those files.
.bin102 MB · 100%
From the Hugging Face model README
ResNet model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper Deep Residual Learning for Image Recognition by He et al.
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.
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.

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.
pip install --upgrade --upgrade-strategy eager optimum[openvino]
optimum-cli export openvino --model microsoft/resnet-50 ov_model/
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
from optimum.intel import OVModelForImageClassification
import torch
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = AutoImageProcessor.from_pretrained("Charles95/openvino_resnet50")
model = OVModelForImageClassification.from_pretrained("Charles95/openvino_resnet50")
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])
For more code examples, we refer to the documentation.
pytorch infer avg ≈66.5ms
openvino infer avg ≈7.9ms
3090 with transformers infer avg ≈6.3ms
improve ≈800%
@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}
}