sam3
/sam3
Wykonuje segmentację instancji obiektów w Segment Anything 3 na podstawie tekstu, punktów lub ramek oraz śledzi obiekt przez klatki wideo z pamięcią tożsamości.
- Autor
- graph-robots ↗
- Repozytorium
- open-robot-skills ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 12.09.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 6
- Skrypty
- 2
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 12.09.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
- 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: _streaming.py, tools.py
Co robi i kiedy
Wykonuje segmentację instancji obiektów w Segment Anything 3 na podstawie tekstu, punktów lub ramek oraz śledzi obiekt przez klatki wideo z pamięcią tożsamości.
Oryginalny opis (EN)
Segment Anything 3 — text-, point-, and box-prompted instance segmentation, plus a stateful streaming video tracker that carries object identity through SAM3's memory bank. Use when a workflow needs open-vocabulary masks from an RGB image or needs to follow one object across frames.
Jak działa
- When to use
- Install
- Gotchas (carried over from the servicers)
Podgląd SKILL.md
---
name: sam3
description: Segment Anything 3 — text-, point-, and box-prompted instance
segmentation, plus a stateful streaming video tracker that carries object
identity through SAM3's memory bank. Use when a workflow needs open-vocabulary
masks from an RGB image or needs to follow one object across frames.
license: MIT
compatibility: requires gap>=0.1
metadata: {category: perception, tags: [perception, segmentation, tracking, gpu]}
gap:
requires: {gpu: true, weights: true}
serving:
command: ["python", "-m", "gap_core.rpc.server", "--bundle", "sam3"]
protocol: stdio-msgpack
requires_gpu: true
tools:
- sam3.segment_text: Segment all instances matching a text description (masks, scores, boxes best-first).
- sam3.segment_point: Segment the object at a pixel coordinate (multimask, best-first).
- sam3.segment_box: Segment within a bounding box, optionally refined by a foreground point.
- sam3.tracker_init: Open a tracker session seeded with one frame + a text/box/point prompt.
- sam3.tracker_update: Advance a tracker session by one frame (mask, box, confidence).
- sam3.tracker_close: Free a tracker session (idempotent).
---
# sam3
The SAM3 image servicer + video-tracker servicer as in-process tools. Images
are RGB uint8 `[H, W, 3]` numpy arrays; masks come back as gap `Mask`
(uint8 `[H, W]`, 0 background / 255 foreground), score-sorted best-first.
## When to use
- `segment_text` for open-vocabulary "find the X" masks (one mask per
instance; check `scores[0]` — callers typically reject below ~0.3).
- `segment_box` after a detector (e.g. `grounding-dino.detect`) for a
pixel-accurate mask inside the detection box; add the point prompt
(`use_point=True`) when a pointing model supplies one.
- `tracker_init` / `tracker_update` / `tracker_close` to follow a single
target across an observation stream (e.g. for visual servoing).
## Install
```bash
uv sync --extra sam3 # torch + torchvision + the upstream sam3 package
# (pip: pip install -e ".[sam3]")
```
Model weights download on first model build. Device is taken from
`GAP_SAM3_DEVICE` (default `cuda`); the image model also runs on `cpu`
(slow), the video tracker is CUDA-only in practice.
## Gotchas (carried over from the servicers)
- **Lazy singletons**: the image model and the video predictor each load on
first call and stay resident; importing the bundle never imports torch.
- `segment_text` caps results at `max_results=5` by default — cluttered
scenes emit 100+ instances (~1 MB/mask at 720p) and downstream consumes
only the top mask. Pass `max_results<=0` for everything.
- The video tracker JIT-compiles **Triton NMS kernels** via the `CC` env
var; a stale `CC` (e.g. a Ray env pointing at a non-existent gcc-13)
surfaces as `FileNotFoundError` inside `tracker_init`. The bundle forces
`CC` to a real compiler before tracker use (`_ensure_cc_compiler`).
- Tracker prompt precedence is **box > point > text**; a point prompt is
converted to a small (10% of image) box because the predictor's box path
is more reliable for init than a single point.
- The tracker is built with `apply_temporal_disambiguation=False` — the
default hotstart heuristics silently delete the masklet around frame 3 in
streaming mode (no fresh text re-detection per frame).
- Drift handling in `tracker_update`: a mask-area jump >1.5x the running
median or confidence <0.30 keeps the LAST GOOD mask and reports
`confidence=0.0` with `object_present=True` (skip this frame); after 5
consecutive drift hits `object_present=False` — re-init the tracker.
- Sessions idle longer than 120 s are evicted lazily on the next tracker
call; an evicted/unknown `tracker_id` raises `ToolError`.
- `tracker_init` returns `object_present=False` with an empty `tracker_id`
(no exception) when the initial detection finds nothing.
Pliki w paczce (6)
- .python-version 1 KB
- SKILL.md 4 KB
- _streaming.py 7 KB
- pyproject.toml 2 KB
- tools.py 28 KB
- uv.lock 317 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · graph-robots/open-robot-skills | 100 | Apache-2.0 |
| brekkylab/ailoy | 95 | Apache-2.0 |
Migawka bazy z 13.11.2026 · wersja paczki 4036ab69ade1 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 95segment-anything-model
Segmentuje dowolne obiekty na obrazach bez treningu, na podstawie punktów, ramek lub masek, albo generuje wszystkie maski naraz. - 100segment-anything-model
Segmentuje obiekty na obrazach bez dodatkowego treningu na podstawie punktów, ramek lub masek, albo generuje wszystkie maski. - 100sam3-segmentation
Wyznacza maski i kontury obiektów na zdjęciach modelem SAM 3 uruchamianym lokalnie na GPU NVIDIA, także przy liczeniu i annotacji wielu drobnych elementów. - 96sam3-segmentation
Dodaje do aplikacji segmentację obrazów modelem SAM 3.1, czyli wydzielanie obiektów na zdjęciach. - 96image-blast-3d
Generuje jeden atomowy obiekt 3D na podstawie nazwy lub obrazu referencyjnego. - 87memory-bank
Prawdopodobnie zbiór wytycznych do pracy z pamięcią projektu, czyli plikami memory-bank, które utrzymują kontekst między sesjami.