MobileViT-XXS — 3D Print Failure Detector

Binary image classifier: normal vs failure (spaghetti / bed detachment). Designed for on-device inference on Raspberry Pi 4 via ONNX Runtime (~200–400 ms/frame).

Labels

ID Label
0 failure
1 normal

ONNX Inference (Raspberry Pi)

import onnxruntime as ort
import numpy as np
from PIL import Image
from transformers import MobileViTImageProcessor

processor = MobileViTImageProcessor.from_pretrained("Masamsa/3d-print-failure-mobilevit-xxs")
sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])

img = Image.open("frame.jpg").convert("RGB")
inputs = processor(images=img, return_tensors="np")
logits = sess.run(["logits"], dict(inputs))[0]
pred   = int(np.argmax(logits, axis=-1)[0])
label  = {0: "normal", 1: "failure"}[pred]
print(label)

Training Details

  • Base: apple/mobilevit-xx-small (1.3M params)
  • Image size: 256×256
  • Best val macro-F1: 0.9011
  • Near-balanced dataset (normal≈3.7K / failure≈3.3K) — standard cross-entropy loss
Downloads last month
61
Safetensors
Model size
956k params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Masamsa/3d-print-failure-mobilevit-xxs

Quantized
(5)
this model

Dataset used to train Masamsa/3d-print-failure-mobilevit-xxs