zero-shot-object-detection Β· vision + language Β· WASM Β· ~205 MB
Grounding DINO is a phrase-grounding detector: instead of a fixed label list, you
give it a caption β a cat. a remote control. a laptop. β and it grounds each phrase
to the regions that match, with a score. It fuses a Swin vision backbone with a BERT text encoder
so the words and the image are compared in one model. New description, no retraining, on your
device.
| Model | onnx-community/grounding-dino-tiny-ONNX (ONNX port of IDEA-Research/grounding-dino-tiny) |
|---|---|
| Task / pipeline | zero-shot-object-detection β phrase grounding |
| Architecture | Grounding DINO β Swin-Tiny image backbone + BERT text encoder, cross-modality fusion, DINO detection head |
| Prompt | A caption of phrases separated by periods (lowercased); each phrase is grounded to boxes |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~205 MB, cached after first load |
| License | Apache-2.0 (IDEA-Research Grounding DINO) |
| Web APIs | WebAssembly, Web Workers, Canvas, FileReader β all Baseline widely available |
Grounding DINO is a sizeable model 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.
Pick or drop an image, write a caption of phrases (separate them with periods), and hit Detect. Grounding DINO runs once at a low floor; the score slider then filters the boxes live without re-running the model.
Grounding DINO fuses your caption's tokens with image features, then decodes boxes and, for each, a similarity to every phrase β the phrase it matches best becomes its label, and that score is what the threshold filters. Below is the real output: a per-phrase summary (how many regions grounded and the best score), then the raw boxes with their matched phrase and pixel coordinates. This is what the model returned β no post-processing beyond the score filter.
| phrase | matches | best score |
|---|
Raw boxes β the grounded tokens column is exactly what the model returned (a box can activate several phrase tokens at once), while phrase is the best-matching input phrase used for colouring.
| # | phrase | grounded tokens | score | x | y | w | h |
|---|
Because the prompt is language, Grounding DINO detects things a fixed detector never learned β and it reads referring phrases, not just nouns. "a person wearing red", "the empty shelf", "a dog on the left" are all valid prompts. That turns bespoke detection from a training project into a sentence, running client-side with nothing uploaded.
Write a caption of phrases, hit detect, and watch Grounding DINO ground each phrase to boxes.
Describe-to-inspect β ground checklist phrases ("a helmet", "an exit sign") and count them, no training.
Ask for referring phrases β "something unusual", "the odd one out" β and see what grounds.
Grounding DINO grounds a phrase β SlimSAM returns its exact pixel mask.
Phrase grounding is a one-liner with Transformers.js β the caption's phrases are the argument:
import { pipeline } from "@huggingface/transformers";
const detect = await pipeline(
"zero-shot-object-detection",
"onnx-community/grounding-dino-tiny-ONNX",
); // downloads + caches ~205 MB once
// Each phrase should be lowercased and end with a period.
const phrases = ["a cat.", "a remote control.", "a person wearing red."];
const output = await detect(imageURL, phrases, { threshold: 0.3 });
// β [{ label: "a cat", score: 0.45, box: { xmin, ymin, xmax, ymax } }, β¦]
// label is the matched phrase; boxes are in image 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 caption 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.