Instructions to use cp500/scenetoken-carparts-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cp500/scenetoken-carparts-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="cp500/scenetoken-carparts-v1", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("cp500/scenetoken-carparts-v1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
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 stats
Architecture
| stage | impl | params | role |
|---|---|---|---|
| Detector | YoloSegmenter (Ultralytics YOLO26n-seg) |
3.06 M | 23-class carparts segmentation |
| Vision encoder | DinoV2Extractor (facebook/dinov2-small, frozen) |
22 M | patch-pool 384-d feature per bbox |
| Attribute head | TinyMLPHead (2-layer MLP, 24-d trunk) |
21 K | 81 per-slot softmax heads |
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)
| variant | params | test_all | test_hard (35 diverse slots) |
|---|---|---|---|
| Routed head (prior + loss-weighted MLP) | 24,606 | 0.8895 ± 0.004 | 0.7935 ± 0.008 |
| Monolithic h=24 MLP | 18,342 | 0.8758 | — |
| Entity-mode prior (zero-param) | 0 | 0.8482 | 0.6602 |
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 API
Training 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.
- Downloads last month
- 7