Skip to main content

Training Service & Activation

The app never trains on the phone. It exports a curated ZIP; a separate service validates, trains and publishes models. Users keep using the current model while training runs.

Run​

cd I:\down\fabrika\ai_training\training_service
python -m pip install -r requirements.txt
$env:FABRIKA_TRAINING_TOKEN='replace-with-long-random-token'
python app.py

Admin → Training & OTA → set Base URL (LAN/HTTPS) + token → save. Enable the service switch. Export/upload, then start a run and poll status.

Endpoints​

  • POST /v1/datasets/import raw ZIP, returns dataset_id.
  • POST /v1/train {dataset_id,target} starts a background run.
  • GET /v1/runs/{run_id} status + metrics.
  • POST /v1/runs/{run_id}/publish only if gate_passed.
  • GET /v1/ota/manifest latest published manifest.
  • GET /v1/ota/{version}/model.onnx artifact.

Clean-data checks​

The training script rejects sessions that are not approved, lack consent or a second reviewer, fail the quality gate, have missing six angles/four audio zones, or have low-quality images. It splits by session, never random images, to prevent leakage. It requires at least two condition classes. It trains image-level condition labels; a bounding-box component detector needs a separate annotation pipeline.

Gate​

Default gate: macro-F1 ≥ 0.80 and macro precision ≥ 0.85. Publish is blocked when the gate fails. This is not yet a paid fault model gate; a production fault model needs ≥0.90 per actionable class, clean-engine false positives ≤5%, calibration ≤0.05 and human review.