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 model | patrickjohncyh/fashion-clip |
|---|---|
| Immutable revision | 7e3ba62ce16b379a1ab479346b66f192e76f51b7 |
| Task / I/O | zero-shot-image-classification · one image + English labels → one relative score per label |
| Architecture | FashionCLIP 2.0 · CLIP ViT-B/32 vision and text towers · 512-dimensional shared projection |
| Artifact | onnx/model.onnx · fp32 · exactly 605,804,513 bytes (577.74 MiB, shown as 578 MiB) |
| Runtime | Transformers.js 3.7.5 · ONNX Runtime Web · WASM · module Web Worker |
| License | MIT |
| Training context | Fine-tuned from LAION CLIP on about 800K English Farfetch product image/text pairs; centred white-background product photos dominate. |
Run it locally
Stage 2 · General CLIP
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.
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.
backend —latency —image tensor —text tensor —
| Label | cosine | scaled logit | relative score |
|---|
Why it matters
- Editable taxonomies: change labels without retraining a classifier.
- Private visual search: image and vocabulary stay local.
- Domain-specific probes: colours, materials, styles and merchandising language can be compared in one space.
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
Basics · product type
Distinguish garment and accessory types
Basics · colour + material
Probe combined fashion attributes
Practical · catalogue taxonomy
Private catalogue auto-routing
Practical · semantic search
Rank product descriptions against an image
Wild · merchandising briefs
Turn a creative brief into a visual ranking
Wild · distribution radar
Spot imagery unlike the training catalogue
Multi-model · domain adaptation check
Compare FashionCLIP with general CLIP
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.