A ResNet-50 v2 trained on ImageNet, exported to ONNX: classifies an image into one of 1,000 categories.
About
ResNet-50 (version 2, with pre-activation residual blocks) trained on the ImageNet-1k classification set and exported to ONNX (opset 7) by the ONNX Model Zoo. A dependable baseline for image classification and a common backbone for transfer learning.
Input and output
- Input:
float32[N, 3, 224, 224]— RGB images resized to 224 × 224, scaled to 0–1 and normalised with the ImageNet mean[0.485, 0.456, 0.406]and standard deviation[0.229, 0.224, 0.225]. - Output:
float32[N, 1000]scores for the ImageNet classes; apply softmax for probabilities.
import onnxruntime as ort
session = ort.InferenceSession("resnet50-v2-7.onnx")
scores = session.run(None, {session.get_inputs()[0].name: batch})[0]
Licence
Apache-2.0, from the ONNX Model Zoo on GitHub.