CoolFace
Modelpublic

cp500/scenetoken-carparts-v1

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes27downloads
Model Card

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

python
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

stageimplparamsrole
DetectorYoloSegmenter (Ultralytics YOLO26n-seg)3.06 M23-class carparts segmentation
Vision encoderDinoV2Extractor (facebook/dinov2-small, frozen)22 Mpatch-pool 384-d feature per bbox
Attribute headTinyMLPHead (2-layer MLP, 24-d trunk)21 K81 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)

variantparamstest_alltest_hard (35 diverse slots)
Routed head (prior + loss-weighted MLP)24,6060.8895 ± 0.0040.7935 ± 0.008
Monolithic h=24 MLP18,3420.8758—
Entity-mode prior (zero-param)00.84820.6602

Ancillary

The pure Ultralytics YOLO26n-seg weight is shipped alongside as yolo.pt. If you only need Stage 1 segmentation:

python
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.