Add operator YOLO training dataset tooling
This commit is contained in:
@@ -261,6 +261,46 @@ plus a combined `multi_sample_quality_summary.json` with
|
||||
container-style `/app/storage/...` manifest paths to repo-relative
|
||||
`storage/...` paths when run from the Tower host checkout.
|
||||
|
||||
Export the same operator samples to a local YOLO detection dataset when the
|
||||
public model candidates are not strong enough for the target imagery:
|
||||
|
||||
```bash
|
||||
docker exec -it geointel python /app/scripts/export_operator_yolo_dataset.py \
|
||||
--manifest-path /app/storage/operator-data/operator_samples_manifest.json \
|
||||
--output-dir /app/storage/operator-data/yolo-building-dataset \
|
||||
--val-samples turnhout \
|
||||
--force
|
||||
```
|
||||
|
||||
The exporter writes `dataset.yaml`, `images/train`, `labels/train`,
|
||||
`images/val`, `labels/val` and `yolo_dataset_summary.json`. It uses only the
|
||||
explicit operator sample manifest and GRB building references where
|
||||
`source_name=grb` and `reference_layer_name=buildings`. It does not call
|
||||
GeoIntel APIs, create provider data, run inference or train a model.
|
||||
|
||||
Run a small local training smoke only in an AI-enabled runtime with an existing
|
||||
local base model file:
|
||||
|
||||
```bash
|
||||
docker exec \
|
||||
-e OPERATOR_YOLO_DATASET_DIR=/app/storage/operator-data/yolo-building-dataset \
|
||||
-e YOLO_BASE_MODEL_PATH=/app/models/yolov8n.pt \
|
||||
-e TRAIN_MODEL_OUTPUT_PATH=/app/models/geointel-building-detector.pt \
|
||||
-e TRAIN_EPOCHS=8 \
|
||||
-e TRAIN_IMGSZ=512 \
|
||||
-e TRAIN_BATCH=2 \
|
||||
-e TRAIN_WORKERS=0 \
|
||||
-e TRAIN_DEVICE=cpu \
|
||||
geointel bash /app/scripts/train_operator_yolo_detector.sh
|
||||
```
|
||||
|
||||
The training wrapper is intentionally outside the product UI. It runs
|
||||
Ultralytics from the existing runtime, copies the best trained artifact to
|
||||
`TRAIN_MODEL_OUTPUT_PATH` and writes `training_summary.json`. Afterward, treat
|
||||
the resulting `.pt` file like any other local model asset: verify preflight,
|
||||
run the real-data matrix and compare persisted QA/QC metrics before activating
|
||||
it as a useful default.
|
||||
|
||||
Export calibration QA evidence for visual review:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user