--- license: mit task_categories: - image-classification tags: - racing - telemetry - gear-detection - motorsport - digit-recognition - onboard-camera pretty_name: Racing Gear Digits size_categories: - 1K ``` This creates `raw//unlabeled/` frames and a `composites//unlabeled.png` contact sheet. 2. **Label** by reading the contact sheet and creating `labels/.csv`: ```csv start,end,label 0,14,5 15,39,6 ``` Each row maps a frame range (inclusive, 0-indexed) to a gear digit. 3. **Build** the dataset: ```bash uv run python scripts/build_dataset.py ``` This reads all `raw/` sources and `labels/` CSVs, does stratified train/val splitting, augments minority classes, and writes the parquet files. ## Augmentations (racing_aug) For racing classes with fewer than 200 training samples, synthetic samples are generated: - **Random translation** — up to ±3px shift in x/y - **Brightness jitter** — 0.7–1.3× - **Contrast jitter** — 0.8–1.2× - **Gaussian noise** — σ=8, 30% probability ## Usage ```python from datasets import load_dataset ds = load_dataset("tobil/racing-gears") # Filter to real racing images only racing = ds["train"].filter(lambda x: x["source"] not in ("mnist", "racing_aug")) # Standard training loop for example in ds["train"]: image = example["image"] # PIL Image, 32x32 grayscale label = example["label"] # int 0-9 source = example["source"] # source identifier ``` ## Context Built for the [mpv racing telemetry plugin](https://github.com/tobi/mpv-telemetry) which reads baked-in telemetry from racing onboard videos using mpv's `screenshot-raw` API and renders a live overlay with throttle/brake traces, gear indicator, and steering position. The gear digit is detected using a small CNN (ONNX) called via LuaJIT FFI from mpv's Lua scripting environment at 30fps.