← All models

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

Grounding DINO β€” point at things by describing them in a sentence

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.

At a glance

Modelonnx-community/grounding-dino-tiny-ONNX (ONNX port of IDEA-Research/grounding-dino-tiny)
Task / pipelinezero-shot-object-detection β€” phrase grounding
ArchitectureGrounding DINO β€” Swin-Tiny image backbone + BERT text encoder, cross-modality fusion, DINO detection head
PromptA caption of phrases separated by periods (lowercased); each phrase is grounded to boxes
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~205 MB, cached after first load
LicenseApache-2.0 (IDEA-Research Grounding DINO)
Web APIsWebAssembly, 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.

Run it

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.

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

See inside

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.

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

Why it matters

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.

Use cases

Basics

Write a caption of phrases, hit detect, and watch Grounding DINO ground each phrase to boxes.

Practical

Describe-to-inspect β€” ground checklist phrases ("a helmet", "an exit sign") and count them, no training.

Wild

Ask for referring phrases β€” "something unusual", "the odd one out" β€” and see what grounds.

Multi-model

Grounding DINO grounds a phrase β†’ SlimSAM returns its exact pixel mask.

How the API works

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.

References