← All models

zero-shot-object-detection Β· vision + language Β· WASM Β· ~400 MB

OWLv2 β€” detect anything you can describe in an image

Ordinary detectors only know the classes they were trained on. OWLv2 is open-vocabulary: you type the objects you want as free text β€” a cat, a remote control, a person wearing red β€” and it embeds each phrase and each image region into a shared space, then boxes the regions that match. New label set, no retraining, all on your device.

At a glance

ModelXenova/owlv2-base-patch16-ensemble
Task / pipelinezero-shot-object-detection
ArchitectureOWLv2 β€” ViT-B/16 image encoder + text encoder, per-region query matching
VocabularyOpen β€” any text query you provide at runtime (no fixed class list)
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~400 MB, cached after first load
LicenseApache-2.0 (Google OWLv2)
Web APIsWebAssembly, Web Workers, Canvas, FileReader β€” all Baseline widely available

OWLv2 is a big model and runs on the CPU here, so the first detect after loading can take a few seconds β€” honest progress is shown, and it is genuinely running on your device.

Run it

Pick or drop an image, type the objects you want as comma-separated text, and hit Detect. OWLv2 runs once at a low floor; the score slider then filters the boxes live without re-running the model.

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
0.10

See inside

OWLv2 turns every text query into a vector and every candidate image region into a vector in the same space, then scores each region against each query by similarity β€” that score is what the threshold filters. Below is the real output: a per-query summary (how many regions matched and the best score), then the raw boxes with their matched query and pixel coordinates. This is what the model returned β€” no post-processing beyond the score filter.

Run detection to see per-query scores and the raw boxes.

Why it matters

Every fixed-class detector forces the same question: "is your object one of the 80 it knows?" If not, you collect a dataset and fine-tune. OWLv2 removes that step β€” the class list is an input, typed at runtime, in the browser, for free. That turns bespoke detection from a training project into a text box.

Use cases

Basics

Type your own labels, hit detect, and watch OWLv2 box exactly what you described.

Practical

Custom inventory / inspection β€” count "a forklift" or "a helmet" with no training.

Wild

Ask for weird things β€” "something dangerous", "the odd one out" β€” and see what matches.

Multi-model

OWLv2 finds a region β†’ SlimSAM returns its exact pixel mask.

How the API works

Open-vocabulary detection is a one-liner with Transformers.js β€” the query list is just an argument:

import { pipeline } from "@huggingface/transformers";

const detect = await pipeline(
  "zero-shot-object-detection",
  "Xenova/owlv2-base-patch16-ensemble",
); // downloads + caches ~400 MB once

const queries = ["a cat", "a remote control", "a person wearing red"];
const output = await detect(imageURL, queries, { threshold: 0.1, percentage: false });
// β†’ [{ label: "a cat", score: 0.29, box: { xmin, ymin, xmax, ymax } }, …]
//   label is the matched query; percentage:false gives pixel coordinates

This page runs the model once at a low floor threshold inside a Web Worker, caches every box, and filters the cached list as you drag the slider β€” so the slider is instant and never re-runs inference. Changing the query text re-runs the model (new text embeddings). The canvas is drawn at the image's natural resolution and scaled by CSS, so boxes stay pixel-accurate.

References