NNEngine/RenNEt18_CIFAR10
By NNEngine · ↓ 0 · ♥ 1 · Updated 2025-08-15
What's in this repo
This page lists the files in NNEngine/RenNEt18_CIFAR10, including resnet18_cifar10.onnx.
- 1 ONNX models (.onnx files)
- 3 files, including 1 .md, 1 .onnx
- Last updated 2025-08-15
ONNX files
| File | Size | Download |
|---|---|---|
| resnet18_cifar10.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
ResNet-18 trained on CIFAR-10 (ONNX)
This is a ResNet-18 model trained on the CIFAR-10 dataset, exported to the ONNX format for easy deployment across different platforms.
Model Details
- Architecture: ResNet-18 (modified for CIFAR-10 input size)
- Framework: PyTorch → ONNX export
- Input size:
3 × 224 × 224RGB images - Number of classes: 10 (airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck)
Intended Use
This model is designed for educational purposes, demos, and quick prototyping of ONNX-based image classification workflows.
How to Use
import onnxruntime as ort
import numpy as np
from PIL import Image
# Load model
session = ort.InferenceSession("resnet18_cifar10.onnx")
# Preprocess image
def preprocess(img_path):
img = Image.open(img_path).convert("RGB").resize((224, 224))
img_data = np.array(img).astype(np.float32) / 255.0
img_data = np.transpose(img_data, (2, 0, 1)) # CHW format
img_data = np.expand_dims(img_data, axis=0) # Batch dimension
return img_data
input_data = preprocess("example.jpg")
# Run inference
outputs = session.run(None, {"input": input_data})
pred_class = np.argmax(outputs[0])
print("Predicted class:", pred_class)
Model info
Created: 2025-08-15
Updated: 2025-08-15
View on Hugging FaceFiles (3)
Related models
More from NNEngine
No other models by this author.