← All models

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

OWLViT β€” the original detect-anything-you-describe model

OWLViT was the first vision transformer to do open-vocabulary detection: you type the objects you want as free text β€” a cat, a remote control, a potted plant β€” and it embeds each phrase and each image region into a shared CLIP space, then boxes the regions that match. No fixed class list, no retraining, all on your device. It's the model OWLv2 was built to improve on.

At a glance

ModelXenova/owlvit-base-patch32
Task / pipelinezero-shot-object-detection
ArchitectureOWLViT β€” CLIP ViT-B/32 image encoder + text encoder, per-region query matching
VocabularyOpen β€” any text query you provide at runtime (no fixed class list)
Quantizationq8 (8-bit) ONNX (model_quantized.onnx)
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~155 MB, cached after first load
LicenseApache-2.0 (Google OWLViT)
Web APIsWebAssembly, Web Workers, Canvas, FileReader β€” all Baseline widely available

OWLViT runs on the CPU here, so the first detect after loading takes a couple of seconds β€” honest progress is shown, and it is genuinely running on your device.

OWLViT (v1) vs. OWLv2 β€” honestly

Both take the same input (an image + your text queries) and return the same shape (boxes + labels + scores). What differs:

 OWLViT (this page)OWLv2
Released2022 β€” the original2023 β€” the successor
TrainingDetection + CLIP contrastive pre-trainingAdds self-training on ~2B pseudo-box web images (OWL-ST)
Backbone hereViT-B/32 (patch 32)ViT-B/16 ensemble (patch 16)
Typical accuracyStrong, the baselineHigher recall on rare / long-tail phrases
Download~155 MB (q8)~400 MB (q8)
Speed hereLighter / faster per runHeavier, generally more accurate

The honest summary: OWLViT is smaller and quicker and still genuinely open-vocabulary; OWLv2 usually finds more, especially for unusual descriptions. Try the same queries on both pages and compare.

Run it

Pick or drop an image, type the objects you want as comma-separated text, and hit Detect. OWLViT 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

OWLViT turns every text query into a vector and every candidate image region into a vector in the same CLIP 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. OWLViT removed that step β€” the class list is an input, typed at runtime, in the browser, for free. It's the model that made "detect anything you can name" practical, and it's small enough to ship to a phone.

Use cases

Basics

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

Practical

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

Wild

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

Multi-model

OWLViT 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/owlvit-base-patch32",
); // downloads + caches ~155 MB once

const queries = ["a cat", "a remote control", "a potted plant"];
const output = await detect(imageURL, queries, { threshold: 0.1, percentage: false });
// β†’ [{ label: "a cat", score: 0.58, 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