Views
No views yet
| model | top-1 | Δ vs FP32 | size |
|---|---|---|---|
| FP32 baseline | 81.22% | — | 27.0 MB |
| Kenosis quantized | 81.16% | −0.06 | 8.59 MB |
1from huggingface_hub import hf_hub_download
2import numpy as np, onnxruntime as ort
3from PIL import Image
4path = hf_hub_download("CoreEpoch/xcit-tiny12-p8-int8-imagenet", "xcit_tiny12_p8_224_int8_kenosis.onnx")
5sess = ort.InferenceSession(path, providers=["CPUExecutionProvider"])
6img = Image.open("your_image.jpg").convert("RGB")
7scale = 224 / min(img.size) # shorter side to 224, center crop — the measured transform
8img = img.resize((round(img.width*scale), round(img.height*scale)), Image.BICUBIC)
9l, t = (img.width-224)//2, (img.height-224)//2
10img = img.crop((l, t, l+224, t+224))
11x = (np.asarray(img, np.float32)/255.0 - [0.485,0.456,0.406]) / [0.229,0.224,0.225]
12logits = sess.run(None, {"input": x.transpose(2,0,1)[None].astype(np.float32)})[0]
13print(int(np.argmax(logits)))1x3x224x224, RGB, /255, ImageNet mean/std. Output logits [1,1000],
sorted-synset order. run_classify.py / eval_imagenet.py reproduce the demo and table.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