zero-shot-image-classification · vision + language · WASM · ~874 MB
Zero-shot image classification isn't just an English trick. Jina-CLIP v2 learned one shared
space for pictures and 89 languages — so a cat,
un gato, 一只猫, and قطة all land near the same picture of
a cat. Type labels in whatever language you like and watch them score. Nothing leaves your
device.
AltCLIP model class (no Xenova/altclip ONNX either), so it can't
run in the browser today. This demo uses jina-clip-v2
instead — a genuinely multilingual CLIP that does run — for the same capability.
| Model | jinaai/jina-clip-v2 |
|---|---|
| Task | zero-shot-image-classification (via cosine of image ↔ text embeddings) |
| Languages | 89 — including EN, ES, FR, DE, ZH, JA, AR, RU, HI… |
| Architecture | EVA-02 vision tower + Jina XLM-RoBERTa text tower → shared 1024-d space |
| Output | L2-normalised image + text embeddings → cosine similarity per label |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (no WebGPU needed) |
| Download | ~874 MB — a large model; desktop / good connection recommended. Cached after first load. |
| License | CC-BY-NC-4.0 (Jina AI) — research / non-commercial |
| Web APIs | WebAssembly, Web Workers, FileReader — all Baseline widely available |
Pick or drop an image, type labels in any languages (comma-separated), and Classify. The bar length is the raw cosine; the % is a softmax over the labels.

Jina-CLIP turns your image into one 1024-number vector and each label into its own 1024-number vector, all L2-normalised. The score is the cosine similarity (a dot product of the normalised vectors) between the image and each label. Because the text tower is multilingual, translations of the same concept sit close together in that space — so they score alike against the same image. Below are the raw numbers.
| Label | cosine sim | softmax |
|---|
Most vision-language models are English-first. A multilingual one means your labels, prompts, and tags can be written by the people who actually use your product — in their language — with no translation step and no server.
Classify an image with labels in a language that isn't English.
Multilingual tagging & moderation against a fixed multi-language label set.
Label the same image in 5 languages at once and watch the scores line up.
Caption the image, then cross-lingually ground the caption against the picture.
jina-clip-v2 returns embeddings, not logits_per_image, so you take the cosine yourself:
import { AutoModel, AutoProcessor, RawImage } from "@huggingface/transformers";
const model = await AutoModel.from_pretrained("jinaai/jina-clip-v2", { dtype: "q8" });
const processor = await AutoProcessor.from_pretrained("jinaai/jina-clip-v2");
const img = await model({ pixel_values: (await processor.image_processor(image)).pixel_values });
const txt = await model(processor.tokenizer(labels, { padding: true }));
// Both are L2-normalised → cosine is just a dot product.
const cos = dot(img.l2norm_image_embeddings, txt.l2norm_text_embeddings[i]);
This page runs exactly that in a Web Worker so the UI never janks, and keeps the cosine numbers for "See inside".