zero-shot-image-classification · vision · SigLIP ViT-B/16 · Transformers.js 4.3.2 (local worker pin) · WebGPU q4f16 165.0 MB / CPU WASM int8 207.5 MB · Apache-2.0

Marqo-FashionSigLIP Apparel Tagbank & Calibration Lab

Tag any garment photo against an editable zero-shot apparel vocabulary with Marqo/marqo-fashionSigLIP — a SigLIP ViT-B/16 fine-tuned by Marqo for fashion retrieval — running 100% on your device. WebGPU devices with shader-f16 load the q4f16 export (165.0 MB); everything else falls back to universal CPU WASM int8 (207.5 MB). Type your own garment or style probe and watch the cosine, learned-logit sigmoid and temperature-softmax scores update.

Marqo/marqo-fashionSigLIP zero-shot-image-classification WebGPU q4f16 · 165.0 MB CPU WASM int8 · 207.5 MB 768-d · 64 tokens · 224 px Apache-2.0

Garment photo

Apparel photograph canvas. Initialise the model to tag the garment.

Loading starter apparel scene…

Starter apparel scenes & local upload

Drop or paste (Ctrl/⌘+V) · stays on device

Zero-shot ranking (temperature softmax)

Initialise the model to rank the tagbank.

See inside Marqo-FashionSigLIP

SigLIP scores every (image, text) pair independently: logit = exp(logit_scale)·cos + logit_bias. This checkpoint's model.safetensors stores logit_scale = 4.5203 (×91.86) and logit_bias = 0.0, so the raw sigmoid saturates near 1 for any positive cosine — the table makes that visible. Marqo's card ranks with (100 · cos).softmax(), which is what the bars show.

Run the model to populate the per-tag calibration table.

Verified ONNX contract

HF repo
Marqo/marqo-fashionSigLIP @ c56244cc
Classes
SiglipTextModel + SiglipVisionModel + AutoTokenizer + AutoProcessor
WebGPU
q4f16 · text 108,904,023 B + vision 53,686,874 B (165.0 MB total)
CPU WASM
int8 · text 111,125,229 B + vision 93,973,410 B (207.5 MB total)
Tokenizer
tokenizer.json 2,421,300 B · SentencePiece 32k · context 64
Preprocess
224×224 bicubic squash · mean/std 0.5
Runtime
Transformers.js 4.3.2 local pin in worker.js (shared lib stays 3.7.5)
License
Apache-2.0

Why 4.3.2 and not the shared 3.7.5

Stage 0 Chrome probing showed 3.7.5's ORT-Web cannot create the int8 vision session (ConvInteger(10) on /trunk/patch_embed/proj/Conv_quant) and its WebGPU q4f16 path collapses different garments onto the same tag. The local 4.3.2 pin runs both paths with distinct, finite scores; it is scoped to this route's worker.js only.

Show the code — SigLIP calibration: learned-logit sigmoid vs temperature softmax (calibrateScores)
Show the code — Off-main-thread cached text embeddings + vision scoring on Transformers.js 4.3.2 (runScore)

Why it matters

Explore the Marqo-FashionSigLIP use-case ladder

How the API works

Load the tokenizer, processor and both SigLIP towers once (in a worker), embed the prompts, embed the image, and compare L2-normalised vectors:

import { AutoTokenizer, AutoProcessor, SiglipTextModel, SiglipVisionModel, RawImage }
  from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.3.2";

const id = "Marqo/marqo-fashionSigLIP";
const opts = { device: "webgpu", dtype: "q4f16" }; // or { device: "wasm", dtype: "int8" }
const tokenizer = await AutoTokenizer.from_pretrained(id);
const processor = await AutoProcessor.from_pretrained(id);
const textModel = await SiglipTextModel.from_pretrained(id, opts);
const visionModel = await SiglipVisionModel.from_pretrained(id, opts);

const text = tokenizer(["a tailored blazer", "a graphic t-shirt"], { padding: "max_length", max_length: 64, truncation: true });
const { text_embeds } = await textModel(text);
const { image_embeds } = await visionModel(await processor(await RawImage.read(url)));
const cos = image_embeds.normalize().matmul(text_embeds.normalize().transpose(1, 0));
// Marqo card: probs = softmax(100 · cos)

References