cp500/scenetoken-carparts-v1
scenetoken / carparts v1
3-stage visual tokenizer that emits per-detection attribute hyperedges for trim-intelligence analysis.
image → YOLO26n-seg → DINOv2-small patch-pool → tiny MLP
↓
[hyperedge] (instance, slot, value, conf)Quickstart
from transformers import AutoModel
model = AutoModel.from_pretrained(
"cp500/scenetoken-carparts-v1", # or a local snapshot dir
trust_remote_code=True,
)
# single image
result = model.predict("car_review_frame.jpg")
for he in result["hyperedges"][:5]:
print(f" ({he['entity']}) {he['slot']} = {he['value']} ({he['confidence']:.2f})")
# video / youtube URL (uses YOLO.track + ByteTrack + our aggregator)
summary = model.predict_video(
"https://www.youtube.com/watch?v=rOlsQFqkU78",
out_dir="outputs/rav4_review/",
show=True, # live OpenCV window with attribute cards
sample_every_s=1.0,
max_frames=200,
)Outputs (video):
outputs/rav4_review/
hyperedges.jsonl every per-frame edge
tracklet_infons.jsonl majority-vote / EMA reduction per tracklet
events.jsonl detected transitions + oscillations (fold, open, flash, ...)
timing.json per-frame latency
manifest.json run config + summary statsArchitecture
Runtime budget: end-to-end ~300 ms / image on Mac MPS cold, ~60 ms warm, 29.6 fps on an AWS L4 GPU.
Ontology
Every slot is declared in ontology.json. The loader resolves shared refs, temporal classes (stable / state / event), and slot aliases. Swap ontology.json + retrain the head to adapt the same pipeline to a different domain.
Validated results (honest stratified test, n=339)
Ancillary
The pure Ultralytics YOLO26n-seg weight is shipped alongside as yolo.pt. If you only need Stage 1 segmentation:
from ultralytics import YOLO
r = YOLO("yolo.pt").predict("car.jpg") # 23-class seg, native Ultralytics APITraining provenance
- 3,156 Ultralytics carparts-seg images
- Glyph+persona teacher labels from Gemma-4-E4B-it (vLLM, self-hosted)
- Stratified 80/10/10 split on (color × trim × viewpoint), frozen by SHA
- Wave 6 (honest splits) / Wave 7 (hard-slot loss weighting) / Wave 8 (routed decoder) methodology documented in the source repo
Authoring a new domain
Replace ontology.json with a domain description (see ontology schema for reference), then retrain with scripts/train_attribute_head.py from the source repo. The code is domain-agnostic; only the JSON changes.
