feat: add detector training, realistic eval, and browser export pipeline - #16
Merged
Conversation
- add 2026-07-13 w384 backbone sweep results (5 backbones, val sfen 0.976-0.999) - collapse A/B/C/D/E design discussions to a single 実装済み summary since regression head, class weight, hand_weight=1.0, cosine+warmup, and resume have all landed - drop v3 修正結果/内訳/config tables that referenced data/ocr_v3/ files never generated - keep v3 as a compact fallback plan for the case realistic captures reveal hand-tail gaps - rewrite the next-iteration priorities around realistic evaluation and backbone selection Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tkgstrator
force-pushed
the
docs/training-plan-w384-refresh
branch
from
July 13, 2026 07:59
d50de5f to
9a1ffc8
Compare
New document w384-sweep-analysis.md records convergence speed, epoch efficiency, and train/val gap analysis from the 384-resolution backbone sweep. Updates TRAINING_PLAN.md and docs/README.md with references. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add HFDetectorDataset to load detector datasets from Hugging Face Hub with per-sample bboxes. Add --hf-repo-id/--hf-config to train_detector.py. Document w224 vs w384 resolution tradeoffs with measured baselines and operational guidance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add asymmetric letterboxing (CropAndPad) for board context preservation - Introduce anisotropic Affine scaling (x/y independent) with adjusted transform ranges - Replace single blur with OneOf mix (GaussNoise, MotionBlur, GaussianBlur) - Increase min_visibility to 0.999 for stricter bbox inclusion in crops - Strengthen image degradation (compression, downscale) and color jitter parameters Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Evaluate BoardOCR against ultemica/piyoshogi-eval (1k SFEN × 4 real devices). Isolates domain gap between training-set tight crops and actual device screenshots. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Allow --best-metric argument to specify which metric selects best.pt. Checkpoints now store best_metric and best_metric_name for resume. Best model is saved to best.pt when a new best is found. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Handle missing/corrupt images gracefully with skip tracking, extract batch flush logic into a helper function, and support .env configuration loading. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds W&B logging for per-(backbone, device) metrics and summary statistics. Introduces --wandb, --wandb-project, and --wandb-run-name arguments to control logging behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wandb-core only reads WANDB__EXTRA_HTTP_HEADERS from the environment, not from wandb.Settings, so inject CF Access credentials early before wandb imports. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Enforce one backbone per invocation to map eval runs 1:1 to training runs - Use backbone name as default run identifier for seamless label pairing - Add --wandb-group for clustering parallel per-backbone eval runs - Remove backbone prefix from metric keys (simplified per-run structure) - Fix summary handling for single-backbone scalar values Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reference material documenting differences between the specification (docs/ocr-model-interface.md §2) and the current BoardDetector implementation in mito_train, including input/output interface, model architecture, training results, and extension costs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removes crop-convention mismatch between piyoshogi-eval's bboxes and OCR training data by using detector-predicted crops. Logs per-device metrics to W&B (one run per backbone). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completed piyoshogi-eval across 5 backbones × 4 devices: convnext_nano/tiny reach 99.92% (exceed val baseline), efficientnet_b1 at 99.67% (Pareto-efficient), mobilenet_v3_large at 97.92% (edge lower bound). iPad board=0% was GT bbox annotation mismatch; resolved with detector bbox preprocessing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MODEL_SPECS now uses factory functions that extract backbone, image_size, and hand_mode from the loaded checkpoint, preserving these settings in the exported ONNX model without requiring additional CLI arguments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Detector training pipeline, realistic eval (OCR-only + end-to-end), ONNX export/release pipeline, browser inference outlook doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
F401 in hf_detector_dataset and verify_onnx, F541 in write_release_notes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tkgstrator
force-pushed
the
docs/training-plan-w384-refresh
branch
from
July 13, 2026 11:34
b2236d4 to
0b569fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
mito_train/training/train_detector.py,HFDetectorDataset, augmented pipeline.runs/board-detector-v1が 100ep で val iou_mean 0.99+ に到達 (仕様書との差分はDETECTOR_STATUS.md)。scripts/eval/eval_realistic.py(OCR 単体, GT bbox → crop → OCR) とscripts/eval/eval_realistic_e2e.py(end-to-end: detector 予測 → crop → OCR)。1 backbone / 1 wandb run、section = device の構造。5 backbone × 4 device × 1000 SFEN 実測。mito_train/export/{to_onnx,to_fp16,quantize}.py、scripts/export/{export_all,verify_onnx,build_release,write_manifest,write_release_notes}、.github/workflows/deployment.yml。detector + 3 OCR backbone を fp32/fp16 で export、MANIFEST に realistic 精度を焼き込み、GitHub Release として archive (本番配信は R2 別インフラ)。docs/w384-sweep-analysis.md(収束・train↔val gap + realistic 評価)、docs/resolution-tradeoff.md(w224 vs w384)、docs/browser-inference-outlook.md(iGPU / iOS / Android 端末別推論時間見積)、docs/model-export.md(export パイプライン)、docs/README.mdの索引。TRAINING_PLAN.mdの backbone 選定を realistic 反映で更新。Why
Test plan
uv run python scripts/export/verify_onnx.pyで全 ONNX が PyTorch と argmax 完全一致 (fp32/fp16)mito-train-board-ocr-w384-v0.3.1-eval-realisticおよび...-eval-realistic-e2eに同期、JSONruns/eval/*.jsonに保存scripts/export/build_release.sh v0.1.0でdist/models-v0.1.0.tar.gz+ MANIFEST + SHA256SUMS + release notes 生成 (release notes に per-backbone realistic 精度と per-device 内訳)os5vtwqmで val iou_mean 0.99+ / @0.9=1.000 (全 device 込み)Version
Bump to v0.3.4 (pre-1.0 rule: feat = patch)
🤖 Generated with Claude Code