$npx -y skills add graph-robots/open-robot-skills --skill grounding-dinoGrounding DINO zero-shot object detection — natural-language
| 1 | # grounding-dino |
| 2 | |
| 3 | The Grounding DINO servicer (`IDEA-Research/grounding-dino-base` via |
| 4 | transformers) as one in-process tool. Image in: RGB uint8 `[H, W, 3]` numpy |
| 5 | array; out: `{detections: [{box, label, score}, ...]}`. |
| 6 | |
| 7 | ## When to use |
| 8 | |
| 9 | - Locating a named object in a camera frame: `grounding-dino.detect(rgb, |
| 10 | "cream cheese box.")`, pick the best box (highest score, or closest to a |
| 11 | pointing-model pixel), then `sam3.segment_box` for a pixel-accurate mask. |
| 12 | - Empty `detections` means nothing cleared the thresholds — treat as |
| 13 | not-found, don't retry blindly with the same prompt. |
| 14 | |
| 15 | ## Install |
| 16 | |
| 17 | ```bash |
| 18 | uv sync --extra grounding-dino # torch + transformers |
| 19 | # (pip: pip install -e ".[grounding-dino]") |
| 20 | ``` |
| 21 | |
| 22 | Weights download from HuggingFace on first call. Env knobs: |
| 23 | `GAP_DINO_DEVICE` (default `cuda`; CPU works but is slow) and |
| 24 | `GAP_DINO_MODEL` (default `IDEA-Research/grounding-dino-base`). |
| 25 | |
| 26 | ## Gotchas (carried over from the servicer) |
| 27 | |
| 28 | - **Period-separated phrases**: GDINO's text encoder expects each object |
| 29 | phrase terminated with `.` (`"red cube. green cube."`). A missing final |
| 30 | period is appended automatically, but separate multiple objects yourself. |
| 31 | - Default thresholds are deliberately low (0.20/0.20) for recall on |
| 32 | household objects; raise them when false positives leak through. Zero or |
| 33 | negative thresholds fall back to the defaults (proto-default semantics). |
| 34 | - `label` strings are the matched text spans, not your full query — when |
| 35 | querying multiple phrases, group detections by label. |
| 36 | - The model is a lazy module-level singleton; the first call pays the |
| 37 | weights-load latency, subsequent calls don't. |