ONNX Model Zoo

Seif-melz/defect-classifier-resnet18

By Seif-melz · ↓ 0 · ♥ 0 · Updated 2025-11-23

What's in this repo

This page lists the files in Seif-melz/defect-classifier-resnet18, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 6 files, including 2 .json, 1 .md, 1 .onnx, 1 .pth
  • Last updated 2025-11-23

ONNX files

File Size Download
model.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

Defect Classifier (ResNet18)

Steel surface defect classification model trained on NEU-DET dataset.

Model Details

  • Architecture: ResNet18
  • Classes: 6 defect types (crazing, inclusion, patches, pitted_surface, rolled-in_scale, scratches)
  • Input: 224x224 RGB images
  • Formats: PyTorch (.pth), ONNX (.onnx)

Files

  • pytorch_model.pth: PyTorch checkpoint
  • model.onnx: ONNX format for deployment
  • metadata.json: Model configuration
  • training_history.json: Training metrics

Usage

PyTorch

import torch
from torchvision import models
from huggingface_hub import hf_hub_download

# Download model
model_path = hf_hub_download(repo_id="Seif-melz/defect-classifier-resnet18", filename="pytorch_model.pth")

# Load model
model = models.resnet18()
model.fc = torch.nn.Linear(model.fc.in_features, 6)
checkpoint = torch.load(model_path, map_location='cpu')
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()

ONNX

import onnxruntime as ort
from huggingface_hub import hf_hub_download

# Download ONNX model
model_path = hf_hub_download(repo_id="Seif-melz/defect-classifier-resnet18", filename="model.onnx")

# Load with ONNX Runtime
session = ort.InferenceSession(model_path)

Training

See training history in training_history.json for detailed metrics.

Model info

pytorch
pytorch onnx computer-vision defect-detection region:us
↓ 0 ♥ 0

Created: 2025-11-23

Updated: 2025-11-23

View on Hugging Face

Files (6)

.gitattributes
README.md
metadata.json
model.onnx ONNX
pytorch_model.pth
training_history.json

Related models