Spaces:
Runtime error
Runtime error
Commit History
-
Add crash-resume + GDrive sync to identifier-continue training
The Kaggle interactive runner pauses when the tab loses focus, and a 9/12 epoch crash used to mean redoing all prior epochs. This adds: - `ContinueConfig.resume_from` / `resume_run_dir` + `--resume` / `--resume-run-dir` CLI flags. Loads the last `epoch_NNN.pt`, restores model state + epoch + stage + best_val, re-applies stage-2 unfreeze when needed, and writes new epochs into the same run dir so `best.pt` / `metrics.json` keep accumulating. - Kaggle notebook: switch guidance to "Save & Run All (Commit)" so tab focus no longer matters, plus rclone-backed GDrive sync cells. Restores prior run on launch, mirrors checkpoints to GDrive every 60s, training cell auto-builds the right `--resume` flags when a prior run is detected. - New section 9 documents the recovery loop end-to-end.266d37e
-
Phase 6: VMMRdb identifier extension (196 → up to ~9,170 make/model/year)
Wires the CC0 Kaggle mirror of VMMRdb into the continued-training path so the make/model/year identifier can recognise far more cars — which flows straight into Variant D / multi-car costing (more cars named → better make/segment cost). - data/vmmrdb.py: loader mirroring the stanford_cars API. Auto-detects the class-folder layout, parses make/model/year from folder names, and supports a `top_n` cap (default 2000) to keep training tractable vs the 9,170-class tail. ROOT resolved at call time so it's reconfigurable. - train/continue_identifier.py + data/compcars.py: re-landed from the Phase-6 branch (warm-start the 196-class ResNet-50, swap head to the new label space, two-stage fine-tune, Stanford make-level forgetting anchor). - ml_identifier: read class_names from the checkpoint so a continue-trained model self-describes its (now ~2000) classes at inference. - CLI: `ccdp train identifier-continue --dataset vmmrdb --top-n 2000`. - download_datasets.sh: opt-in `VMMRDB=1` (C…2ad33c7
-
XGBoost(C): mask-area cost feature from the YOLOv8-seg model
Adds the mask-area path to the cost regressor — true damaged-area % per damage type (vs Variant B's bbox area): - extract_seg_features.py: yoloseg masks -> bbox-compatible feature parquet (GT polygon-area path + real-model path); joins XGBoost like the bbox features. - train_xgb: variant 'c' joins seg features (mirrors 'b'). - CLI: `ccdp train extract-seg-features [--gt]` + `ccdp train xgb --variant c`. Trained + measured locally on CarDD (test split): - GT polygon area (upper bound): R² 0.939, MAPE 10.8% - real yoloseg model masks: R² 0.709, MAPE 25.6% - (for reference) XGBoost(B) bbox: R² 0.736, MAPE 26.0% Honest read: true mask area is a near-perfect predictor of the (synthetic) cost target — but the current yoloseg mask quality (mask mAP50-95 ~0.53) caps the realised feature, landing on par with bbox-based Variant B. The GT↔model gap is headroom a stronger segmenter would unlock. 3 new tests; suite 132 -> 135 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.co…beee3d4
-
Add Stanford Cars as 'no damage' negatives for the classifier
Root cause of the false-positive failure on undamaged cars: CarDD contains only damaged-car photos, so the classifier never sees a 'no damage' example and has no way to predict the empty label set. This commit teaches the trainer to mix Stanford Cars images (which are by-and-large undamaged) into the dataset with all-zero damage labels — Option A from the data-strategy discussion. What's new - iter_negatives() in data/loaders.py: scans Stanford Cars image directory, yields Records with damage_types=[] and dataset tag 'stanford_cars_negative'. Returns nothing (no error) if the directory is missing, so existing CarDD-only flows are unaffected. - mix_negatives() in damage_dataset.py: deterministic, ratio-controlled mixer. Caps at available negatives rather than oversampling with replacement (duplicating identical photos would just teach the model to memorise them). Doesn't mutate inputs. - TrainConfig.negative_ratio + --negative-ratio CLI flag. Default 0.0 preserves legacy …5da26fe
-
checkpoint-3: comparison report, FastAPI, Gradio, HF Space deploy
Phase 3 brings the system to humans. Three deliverables, all reading from the existing v0.1.0 production registry — no new training, no model changes. ## New modules ccdp/preprocess (Stage A: deterministic downscale + quality report). - `normalize_for_inference` LANCZOS-resizes long edges to 1600 px max. - `quality_report` returns sharpness (Laplacian variance), brightness, contrast, low-resolution / low-light / blurry booleans. - Stage B (super-resolution) explicitly deferred to a later checkpoint. ccdp/eval — Variant A vs B head-to-head evaluator. - `metrics.py`: pure per-class P/R/F1 + regression metrics (no sklearn). - `comparison.py`: `build_comparison()` runs both pipelines on the seed=42 test split, returns a `Comparison` dataclass. - `report.py`: Jinja2 -> HTML always; WeasyPrint -> PDF when installed. - `reports/templates/report.html.j2`: A4-formatted report with headline table, per-variant detail, tier/latency, top failures, disclosures. ccdp/api…323fee6 -
Initial commit: end-to-end car damage + repair-cost predictor
Variants A and B trained end-to-end on CarDD + comprehensive + iaai + Stanford Cars datasets, glued together by a versioned parts-cost catalog and a three-tier (exact / nearest-class / catalog-only) cost estimator with full provenance on every prediction. Production metrics (v0.1.0): - Identifier (ResNet50 + RandAugment + MixUp + CutMix): val acc 77.0% - Damage classifier (ResNet50, 6 damage types): val macro-F1 0.834 - YOLOv8n detector: mAP50 0.687, mAP50-95 0.540 - XGBoost(A) (image features only): val R² 0.630, test R² 0.642 - XGBoost(B) (+ bbox features): val R² 0.716, test R² 0.736 64 unit tests pass. Honest disclosures of synthetic-cost limitation in PLAN.md and progress/*.md.4ce7a7e