Skip to page content
SAVRN
Search Plan a project

Open-weight model · Image classification

pixai-tagger-v1.0-onnx-fp32-fp16-int8

by Mexes GM Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8

pixai-tagger-v1.0-onnx-fp32-fp16-int8 is an open-weight model for image classification from Mexes GM, released under Apache License 2.0. Its published files total 3.5 GB.

Unofficial ONNX export of pixai-labs/pixai-tagger-v1.0 in FP32, FP16 and INT8. Runs with ONNX Runtime only. - Input input: float32 [batch, 3, 1008, 1008], RGB, NCHW. - Output prediction: float32 [batch, 30877], probabilities (sigmoid is part of the graph).

Parameters—
Context—
Weights3.5 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By Mexes GM, published under apache-2.0, revision 080077856314.

Unofficial ONNX export of pixai-labs/pixai-tagger-v1.0 in FP32, FP16 and INT8. Runs with ONNX Runtime only. - Input input: float32 [batch, 3, 1008, 1008], RGB, NCHW. - Output prediction: float32 [batch, 30877], probabilities (sigmoid is part of the graph). - Opset 17. training cutoff, and are also scored against their Danbooru tags. - FP16 is meant for GPUs. On CPU it is slower than FP32, because the CPU has no native FP16 math. - FP32 fits on a 4 GB GPU only barely (3.2 GB VRAM), and its speed varies between runs. - INT8 speed depends on CPU support for VNNI instructions. On older CPUs it can be slower than FP32. - Peak RAM on CPU includes session initialization; FP32 briefly reaches 9.4…

Read Mexes GM's full model card

Unofficial ONNX export of pixai-labs/pixai-tagger-v1.0 in FP32, FP16 and INT8. Runs with ONNX Runtime only.

Files

File Precision Size
model.onnx FP32 1.89 GB
model_fp16.onnx FP16 (FP32 input/output) 947 MB
model_int8.onnx Dynamic INT8 (MatMul/Gemm, per-channel) 523 MB
selected_tags.csv tag_id,name,category,count
preprocess.json Preprocessing steps
  • Input input: float32 [batch, 3, 1008, 1008], RGB, NCHW.
  • Output prediction: float32 [batch, 30877], probabilities (sigmoid is part of the graph).
  • Opset 17.

Test results

  • Hardware: AMD Ryzen 5 9600X (6 cores / 12 threads, AVX-512 VNNI), 32 GB RAM, AMD Radeon RX 580X 4 GB.
  • Software: Windows 11, onnxruntime-directml 1.24, batch 1.
  • Images: 6 anime illustrations. 5 of them are Danbooru posts uploaded in September 2026, after the model's training cutoff, and are also scored against their Danbooru tags.
  • Thresholds: the per-category values listed under Categories and thresholds.
  • FP16 is meant for GPUs. On CPU it is slower than FP32, because the CPU has no native FP16 math.
  • FP32 fits on a 4 GB GPU only barely (3.2 GB VRAM), and its speed varies between runs.
  • INT8 speed depends on CPU support for VNNI instructions. On older CPUs it can be slower than FP32.
  • Peak RAM on CPU includes session initialization; FP32 briefly reaches 9.4 GB while loading.

Agreement with FP32 (CPU)

Model Device Max prob. diff Mean prob. diff Tag-set similarity (Jaccard) Tags lost / added (of 317)
FP32 DirectML 6 × 10⁻⁶ 2 × 10⁻⁸ 1.000 0 / 0
FP16 CPU 0.002 7 × 10⁻⁷ 1.000 0 / 0
FP16 DirectML 0.012 6 × 10⁻⁶ 0.997 1 / 0
INT8 CPU 0.103 6 × 10⁻⁵ 0.951 4 / 13

Against Danbooru tags (5 posts)

Model General P / R / F1 Character P / R Copyright P / R Rating
FP32 0.50 / 0.73 / 0.59 6/6 · 6/8 6/7 · 6/6 5/5
FP16 (DirectML) 0.50 / 0.72 / 0.59 6/6 · 6/8 6/7 · 6/6 5/5
INT8 0.49 / 0.73 / 0.59 7/7 · 7/8 6/8 · 6/6 5/5
  • P is precision (correct / predicted) and R is recall (found / expected).
  • Danbooru tag lists are often incomplete, so the general precision shown is a lower bound.
  • Ground-truth tags that are not in the model's vocabulary are excluded (3 general, 1 character, 1 copyright).
  • With 5 images, a difference of one tag between variants is within noise.

Preprocessing

  1. Resize so the longest side is 1008 px (bicubic), keeping aspect ratio.
  2. Paste centered on a 1008 × 1008 black canvas.
  3. Scale to [0, 1], then normalize with mean 0.5 and std 0.5.

Categories and thresholds

category Name Threshold
0 general 0.17
1 style 0.15
3 copyright 0.24
4 character 0.27
5 meta 0.17
9 rating 0.41

Thresholds are the ones recommended in the original model card.

Usage

pip install onnxruntime pillow numpy huggingface_hub
# DirectML (Windows): pip install onnxruntime-directml pillow numpy huggingface_hub
import csv
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download

REPO = "Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8"
CATEGORIES = {0: "general", 1: "style", 3: "copyright", 4: "character", 5: "meta", 9: "rating"}
THRESHOLDS = {"general": 0.17, "style": 0.15, "copyright": 0.24, "character": 0.27, "meta": 0.17, "rating": 0.41}

with open(hf_hub_download(REPO, "selected_tags.csv"), encoding="utf-8") as f:
    tags = [(row["name"], CATEGORIES[int(row["category"])]) for row in csv.DictReader(f)]


def preprocess(path, size=1008):
    img = Image.open(path).convert("RGB")
    scale = size / max(img.size)
    w, h = round(img.width * scale), round(img.height * scale)
    img = img.resize((w, h), Image.Resampling.BICUBIC)
    canvas = Image.new("RGB", (size, size))
    canvas.paste(img, ((size - w) // 2, (size - h) // 2))
    x = (np.asarray(canvas, dtype=np.float32) / 255.0 - 0.5) / 0.5
    return x.transpose(2, 0, 1)[None]


session = ort.InferenceSession(
    hf_hub_download(REPO, "model_fp16.onnx"),
    providers=["CUDAExecutionProvider", "CPUExecutionProvider"],
)
probs = session.run(["prediction"], {"input": preprocess("image.jpg")})[0][0]

results = {}
for (name, category), p in zip(tags, probs):
    if p >= THRESHOLDS[category]:
        results.setdefault(category, {})[name] = float(p)
print(results)

DirectML

so = ort.SessionOptions()
so.enable_mem_pattern = False
so.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
session = ort.InferenceSession(
    "model_fp16.onnx", so,
    providers=[("DmlExecutionProvider", {"device_id": 0}), "CPUExecutionProvider"],
)

Set device_id explicitly on systems with more than one GPU; without it the integrated GPU may be selected (21.8 s vs 5.3 s per image in the test above).

Conversion

pip install torch safetensors numpy onnx onnxruntime onnxconverter-common
python scripts/export_pixai_v1_onnx.py out
python scripts/convert_pixai_v1_fp16.py --src out/model.onnx
python scripts/quantize_pixai_v1_int8.py --src out/model.onnx

The rotary position embeddings are rewritten with real-valued cos/sin, since the complex-number ops used by the original implementation cannot be exported to ONNX.

License

Apache-2.0, same as the original model.

Identity and Version

Repository
Mexes/pixai-tagger-v1.0-onnx-fp32-fp16-int8
Publisher
Mexes GM
Task
Image classification
Modality
Image
Library
onnxruntime
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
0800778563144a0e6fdf41ddadd84aae3cb0dbcf
First published
2026-09-28
Last updated
2026-09-28

Files and Weights

12 files, 3.5 GB in total. The weights are 3 files totalling 3.5 GB in onnx.

Weights3 files · 3.5 GB
Configuration4 files · 20.5 KB
Documentation1 file · 6.2 KB
Other3 files · 953.4 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.onnxWeights2.0 GB 1cae6083f07b
model_fp16.onnxWeights992.9 MB cd668e6760bb
model_int8.onnxWeights548.3 MB 71b78283846a
preprocess.jsonConfiguration288 B —
scripts/convert_pixai_v1_fp16.pyConfiguration1.6 KB —
scripts/export_pixai_v1_onnx.pyConfiguration17.1 KB —
scripts/quantize_pixai_v1_int8.pyConfiguration1.5 KB —
README.mdDocumentation6.2 KB —
assets/latency.pngOther84.2 KB —
assets/memory.pngOther64.5 KB —
selected_tags.csvOther804.7 KB —
.gitattributesRepository1.5 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
3.5 GB
Download from Mexes GM

Released by Mexes GM through its official repository on Hugging Face. Read the license.

Built From

  • Derived from pixai-labs/pixai-tagger-v1.0
  • Quantized from pixai-labs/pixai-tagger-v1.0

Memory Requirements

PrecisionWeights in memory
As published3.5 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About pixai-tagger-v1.0-onnx-fp32-fp16-int8

Can I use pixai-tagger-v1.0-onnx-fp32-fp16-int8 commercially?

Yes. pixai-tagger-v1.0-onnx-fp32-fp16-int8 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Image classification

swinv2-tiny-patch4-window16-256

Microsoft

Swin Transformer v2 model pre-trained on ImageNet-1k at resolution 256x256. It was introduced in the paper Swin Transformer V2: Scaling Up Capacity and Resolution by Liu et al. and first released in this repository. Disclaimer: The team releasing Swin Transformer v2 did not write a model card for this model so this model card has been written by the Hugging Face team. The Swin Transformer is a type of Vision Transformer. It builds hierarchical feature maps by merging image patches (shown in gray) in deeper layers and has linear computation complexity to input image size due to computation of self-attention only within each local window (shown in red). It can thus serve as a general-purpose…

Open weights apache-2.0 transformers

Model · Image classification

AI-image-detector

Matthew Maybe

NOTE: Unless you are trying to detect imagery generated using older models such as VQGAN+CLIP, please use the updated version of this detector instead. This model is a proof-of-concept demonstration of using a ViT model to predict whether an artistic image was generated using AI. It was created in October 2022, and as such, the training data did not include any samples generated by Midjourney 5, SDXL, or DALLE-3. It still may be able to correctly identify samples from these more recent models due to being trained on outputs of their predecessors. Furthermore the intended scope of this tool is artistic images; that is to say, it is not a deepfake photo detector, and general computer imagery…

Open weights cc-by-4.0 transformers

Measured on device (edge-compat): Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.1 ms p50 (2026-08-31); browser · Chromium 151 (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/plantnet-300k-resnet18/CARD.md On-device fine-grained plant species identification — 1081 species — running fully on the LiteRT CompiledModel GPU delegate (no CPU fallback). A PlantNet-300K (NeurIPS 2021) ResNet18. ~16 ms/frame on a Pixel 8a. (mean [0.485,0.456,0.406], std [0.229,0.224,0.225]; center-crop then resize 224). Labels: class index i maps to the i-th species when the PlantNet-300K species-id strings are sorted (torchvision ImageFolder order); names…

Open weights apache-2.0 litert

Model · Image classification

traffic-sign-adverse-weather

Yy

Official model checkpoints for the solution in the Traffic Sign Recognition under Adverse Weather Competition. See classes.txt for the 25 traffic sign classes. For inference scripts, training code, and in-depth engineering retrospective, visit the GitHub Repository.

Open weights mit timm

Model · Image classification

tinyvit-5m-int8-imagenet

Core Epoch

TinyViT-5M (timm/tinyvit5m224.distin22kftin1k, Apache-2.0) quantized to INT8 with Kenosis — 128-image calibration, no retraining. 80.53% top-1 from a 9.2 MB single file, on ONNX Runtime or OpenVINO, CPU or GPU, no accelerator required. ImageNet-1K validation, 49,872 images (disjoint from the 128 calibration images). Measured on a CPU with AVX-VNNI; on CPUs without VNNI this model's INT8 top-1 sits ~0.9 below FP32 rather than 0.34. Input 1x3x224x224, RGB, /255, ImageNet mean/std. Output logits [1,1000], sorted-synset order. runclassify.py / evalimagenet.py reproduce the demo and table. tinyvit5m224int8kenosis.onnx (9,228,567 B) — SHA-256…

Open weights apache-2.0 onnx