Views
No views yet
| Metric | PyTorch V2 | ONNX V2 | Improvement |
|---|---|---|---|
| Inference Time | 68.52ms | 14.99ms | 4.57x faster |
| Model Size | 2.03MB | 2.09MB | Similar |
| Accuracy (Dice) | 1.0000 | 1.0000 | Perfect match |
| Max Difference | - | 0.000003 | Near-zero |
1import onnxruntime as ort
2import numpy as np
3import cv2
4
5# Load model
6session = ort.InferenceSession("ultimate_v2_breakthrough_accurate.onnx")
7
8# Preprocess image
9image = cv2.imread("chess_board.jpg")
10image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
11image_resized = cv2.resize(image_rgb, (256, 256))
12image_normalized = image_resized.astype(np.float32) / 255.0
13input_tensor = np.transpose(image_normalized, (2, 0, 1))[np.newaxis, ...]
14
15# Run inference
16outputs = session.run(None, {"input": input_tensor})
17mask = outputs[0]
18
19# Apply sigmoid for final mask
20final_mask = 1.0 / (1.0 + np.exp(-mask))1from transformers import pipeline
2
3# Load pipeline
4pipe = pipeline("image-segmentation", model="your-username/ultimate-v2-chess-onnx")
5
6# Process image
7result = pipe("chess_board.jpg")| Model | Size | Speed | Accuracy | Use Case |
|---|---|---|---|---|
| V6 Original | 17.49MB | 68ms | Baseline | High accuracy |
| V2 PyTorch | 2.03MB | 68ms | 97.75% | Development |
| V2 ONNX | 2.09MB | 15ms | 100% | Production |
1@model{ultimate_v2_chess_onnx,
2 title={Ultimate V2 Breakthrough Chess Board Segmentation (ONNX)},
3 author={Chess Vision Team},
4 year={2024},
5 url={https://huggingface.co/your-username/ultimate-v2-chess-onnx}
6}