← All models

zero-shot-image-classification · vision + language · WASM · ~874 MB

Match an image to labels in any language

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.

Why not AltCLIP? AltCLIP was the obvious multilingual pick, but Transformers.js ships no 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.

At a glance

Modeljinaai/jina-clip-v2
Taskzero-shot-image-classification (via cosine of image ↔ text embeddings)
Languages89 — including EN, ES, FR, DE, ZH, JA, AR, RU, HI…
ArchitectureEVA-02 vision tower + Jina XLM-RoBERTa text tower → shared 1024-d space
OutputL2-normalised image + text embeddings → cosine similarity per label
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (no WebGPU needed)
Download~874 MB — a large model; desktop / good connection recommended. Cached after first load.
LicenseCC-BY-NC-4.0 (Jina AI) — research / non-commercial
Web APIsWebAssembly, Web Workers, FileReader — all Baseline widely available

Run it

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.

Drop an image here, or click to choose
Two cats sleeping on a pink couch A cozy sunlit bedroom with a bookshelf A riverside at golden hour with a swan
Selected image preview

See inside

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.

Run a classification to see the cosine similarities.

Why it matters

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.

Use cases

Basics

Classify an image with labels in a language that isn't English.

Practical

Multilingual tagging & moderation against a fixed multi-language label set.

Wild

Label the same image in 5 languages at once and watch the scores line up.

Multi-model

Caption the image, then cross-lingually ground the caption against the picture.

How the API works

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".

References