detecting-parts-from-exemplars-sam3
Give it boxes around one or more examples of a part (exemplar_boxes,
pixels in camera's frame), optionally boxes around parts it must not
return (negative_boxes) and a noun phrase (text). It returns a box,
score and mask for every other part SAM 3 finds like the examples, and the
count. The exemplars themselves are left out.
SAM 3's promptable concept segmentation takes box exemplars as positive or negative visual prompts; without text, the tool passes the placeholder phrase "visual" as upstream does for exemplar-only prompts.
Why not PiDiViT
This was meant to port PiDiViT (ICCV 2025, Apache-2.0). Its repository publishes no PiDiViT weights; its README points to DE-ViT's checkpoints (Google Drive, not on Hugging Face) and it builds on detectron2, which is why DE-ViT itself was skipped. SAM 3 is the few-shot exemplar detector here with public weights the hub already uses.
How it composes
- Before it: a box on one or more examples.
owlv2.detectormm-grounding-dinowith a text prompt, a pointing VLM +sam3.segment_point, or an operator click. - After it: the masks go to grasp proposals directly; to name which kit
part each one is,
segmenting-small-parts-from-a-few-reference-photosclassifies masks against labelled references (it labels, this finds). - Instead of it:
detecting-all-like-exemplar(owlv2 / GeCo exemplar search, boxes only, no negative prompts).
Measured
Setup (2026-11-30, pool host gcp1397, RTX PRO 6000; sam3.pt from the
ModelScope mirror): the target-part eval set of tools/README.md, built by
its scripts. 57 MuJoCo renders on real station backgrounds (37 overhead at
~1 m, 20 wrist; generator seeds 30 20 7) and 40 PuzzleMap jigsaw photos
(317 pieces). Same protocol as owlv2-like: for each class in an image, the
largest labelled instance is the exemplar (3-shot: the three largest, when
the class has more than three), searched in its own image; a hit is IoU >=
0.5 with another instance of that class. "Other-class hits" are boxes on a
part of another class (a brick exemplar matching a domino); "false boxes"
match no part. Run with
tests/bundles/_target_parts_eval.py sam3-like and _target_parts_score.py.
| set, class (instances) | sam3, 1 box, floor 0.5 | sam3, 1 box, 0.85 | owlv2.detect_like, 0.85 (its default) | owlv2, 0.7 |
|---|---|---|---|---|
| overhead LEGO (62) | 82 %, 1 false box / 26 searches | 2 %, 0 | 48 %, 14 | 94 %, 647 |
| overhead DUPLO (22) | 95 %, 0 / 12 | 9 %, 0 | 77 %, 1 | 100 %, 138 |
| overhead domino (38) | 87 %, 1 / 19 | 11 %, 0 | 50 %, 2 | 97 %, 313 |
| wrist LEGO / DUPLO / domino (4 / 1 / 5) | 100 / 100 / 100 %, 0 | 0 % | 50 / 100 / 60 %, 0 | 100 %, 44 |
| jigsaw pieces (317) | 100 %, 12 false boxes / 40 photos | 99 %, 0 | 100 %, 1 | 100 %, 262 |
- Overhead, SAM 3 at 0.5 finds 82-95 % of the copies with about one false box per 20 searches; owlv2 at its 0.85 default finds 48-77 %, and lowering owlv2 to 0.7 to match the recall gives hundreds of false boxes.
- SAM 3's scores sit lower than owlv2's: the floor is not shared. 0.5 on bricks and dominoes; 0.85 on the jigsaw photos (at 0.5 the mat edges give 12 false boxes over 40 photos).
- 3 exemplars (classes with more than 3 instances: 16 LEGO, 4 DUPLO, 7 domino left to find) did not beat 1 at 0.5 (75 / 100 / 86 %); they help above 0.6 (LEGO 0.7: 50 % against 34 %).
- Neither tells the kinds apart overhead. At 0.5 a LEGO exemplar also
boxed 80 parts of the other classes over 26 searches (owlv2 0.85: 23 at
much lower recall). To name which part each box is, pass the masks to
segmenting-small-parts-from-a-few-reference-photos(its own eval: kind accuracy 0.59 at 1 reference, 0.72 at 5, from ground-truth masks), or give the look-alike as anegative_boxesexemplar (not measured here). - Time per search 0.075 s median (owlv2 0.035 s); peak GPU memory 4.5 GB.
- Renders and photos only; no real-station frames were run.
Weights and licence
facebook/sam3 is gated on Hugging Face. The pool GPU hosts have no HF
token, so GAP_SAM3_CHECKPOINT points the sam3 tool at a local sam3.pt:
the eval used the public ModelScope mirror
(https://www.modelscope.cn/models/facebook/sam3/resolve/master/sam3.pt,
3,450,062,241 bytes). SAM 3's weights and code are under Meta's SAM License,
as for the existing sam3 tool. This skill's script is the hub's own code
(Apache-2.0).


