XCiT-Tiny-12/P8 β€” INT8 ONNX, 81.2% ImageNet in 8.6 MB

XCiT-Tiny-12/P8 (timm/xcit_tiny_12_p8_224.fb_dist_in1k, Apache-2.0) quantized to INT8 with Kenosis β€” 128-image calibration, no retraining. 81.16% top-1 from an 8.6 MB single file, on ONNX Runtime or OpenVINO, CPU or GPU, no accelerator required.

Accuracy

ImageNet-1K validation, 49,872 images (disjoint from the 128 calibration images).

model top-1 Ξ” vs FP32 size
FP32 baseline 81.22% β€” 27.0 MB
Kenosis quantized 81.16% βˆ’0.06 8.59 MB

Run

from huggingface_hub import hf_hub_download
import numpy as np, onnxruntime as ort
from PIL import Image
path = hf_hub_download("CoreEpoch/xcit-tiny12-p8-int8-imagenet", "xcit_tiny12_p8_224_int8_kenosis.onnx")
sess = ort.InferenceSession(path, providers=["CPUExecutionProvider"])
img = Image.open("your_image.jpg").convert("RGB")
scale = 224 / min(img.size)  # shorter side to 224, center crop β€” the measured transform
img = img.resize((round(img.width*scale), round(img.height*scale)), Image.BICUBIC)
l, t = (img.width-224)//2, (img.height-224)//2
img = img.crop((l, t, l+224, t+224))
x = (np.asarray(img, np.float32)/255.0 - [0.485,0.456,0.406]) / [0.229,0.224,0.225]
logits = sess.run(None, {"input": x.transpose(2,0,1)[None].astype(np.float32)})[0]
print(int(np.argmax(logits)))

Input 1x3x224x224, RGB, /255, ImageNet mean/std. Output logits [1,1000], sorted-synset order. run_classify.py / eval_imagenet.py reproduce the demo and table.

Integrity & license

xcit_tiny12_p8_224_int8_kenosis.onnx (8,589,884 B) β€” SHA-256 1D655EAD9B9A9438F58E46B151CC78FA304D420A56F904D692B43089837CE194. Apache-2.0 (base XCiT, El-Nouby et al. 2021, retained). Quantized with Kenosis (patent pending) Β· coreepoch.dev

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for CoreEpoch/xcit-tiny12-p8-int8-imagenet

Quantized
(1)
this model

Dataset used to train CoreEpoch/xcit-tiny12-p8-int8-imagenet