zero-shot-image-classification · vision + language · WASM · 578 MiB

FashionCLIP — apparel concepts, ranked on your device

A fashion-specialised CLIP model turns a product image and your English labels into comparable 512-number vectors. It runs entirely in a Web Worker: no image upload, no fixed taxonomy and no canned result.

At a glance

Canonical modelpatrickjohncyh/fashion-clip
Immutable revision7e3ba62ce16b379a1ab479346b66f192e76f51b7
Task / I/Ozero-shot-image-classification · one image + English labels → one relative score per label
ArchitectureFashionCLIP 2.0 · CLIP ViT-B/32 vision and text towers · 512-dimensional shared projection
Artifactonnx/model.onnx · fp32 · exactly 605,804,513 bytes (577.74 MiB, shown as 578 MiB)
RuntimeTransformers.js 3.7.5 · ONNX Runtime Web · WASM · module Web Worker
LicenseMIT
Training contextFine-tuned from LAION CLIP on about 800K English Farfetch product image/text pairs; centred white-background product photos dominate.

Run it locally

Large local resource: FashionCLIP downloads 605,804,513 bytes (578 MiB) plus small tokenizer/config files. Allow roughly 1.2 GiB free memory during WASM initialisation. Mobile browsers may evict the cache or terminate the tab; no absent model is auto-downloaded. Use desktop-class hardware when possible.

White heritage sneaker

Prepare the model to enable ranking.

See inside the real forward pass

Run a ranking to inspect the 512-dimensional image/text projections, cosine similarities, scaled logits and relative softmax scores.

Why it matters

Scores are relative similarities, not calibrated facts. The model card warns about gender associations, English-only text, long-caption sensitivity and reduced reliability outside standard product photography.

Use-case ladder

How the API works

const rank = await pipeline(
  "zero-shot-image-classification",
  "patrickjohncyh/fashion-clip",
  { revision: "7e3ba62ce16b379a1ab479346b66f192e76f51b7", dtype: "fp32", device: "wasm" },
);
const scores = await rank(imageURL, ["white sneaker", "sports t-shirt"]);

This family goes one level lower—reusing the pipeline processor, tokenizer and model—to expose real projection tensors, cosines and logits from the same forward pass. Heavy preprocessing and inference stay in the worker.

References