docs(accuracy): refresh governed scan and training evidence

This commit is contained in:
Jens
2026-08-30 06:00:57 +02:00
parent c272220277
commit 0e3c1b20e9
27 changed files with 88787 additions and 318 deletions
+61 -8
View File
@@ -277,6 +277,54 @@ def failure_sampling_command(
return command
def protected_assessment_command(
*,
scripts_dir: Path,
calibration: Path,
test: Path,
background: Path,
output: Path,
selected_threshold: float,
min_aggregate_f1: float,
min_region_f1: float,
min_region_precision: float,
min_region_recall: float,
max_pure_empty_fp: int,
) -> list[str]:
"""Build the one-shot protected assessment command from frozen calibration gates.
The protected assessor must not silently reselect an operating point or
fall back to its own default gates. Keeping command construction in one
helper also makes the release boundary directly testable without opening
any protected inputs.
"""
return [
sys.executable,
str(scripts_dir / "assess_belgium_building_training_iteration.py"),
"--calibration",
str(calibration),
"--test",
str(test),
"--background",
str(background),
"--output",
str(output),
"--selected-threshold",
str(selected_threshold),
"--min-aggregate-f1",
str(min_aggregate_f1),
"--min-region-f1",
str(min_region_f1),
"--min-region-precision",
str(min_region_precision),
"--min-region-recall",
str(min_region_recall),
"--max-pure-empty-fp",
str(max_pure_empty_fp),
]
def resumable_training_command(yolo: str, checkpoint: Path) -> list[str]:
return [yolo, "train", f"resume={checkpoint}", "device=0"]
@@ -572,14 +620,19 @@ def main() -> int:
iteration_dir / f"{role}.log",
)
run(
[
sys.executable,
str(scripts_dir / "assess_belgium_building_training_iteration.py"),
"--calibration", str(reports["calibration"]),
"--test", str(reports["test"]),
"--background", str(reports["background"]),
"--output", str(assessment),
],
protected_assessment_command(
scripts_dir=scripts_dir,
calibration=reports["calibration"],
test=reports["test"],
background=reports["background"],
output=assessment,
selected_threshold=float(chosen["threshold"]),
min_aggregate_f1=args.min_aggregate_f1,
min_region_f1=args.min_region_f1,
min_region_precision=args.min_region_precision,
min_region_recall=args.min_region_recall,
max_pure_empty_fp=args.max_pure_empty_fp,
),
iteration_dir / "assessment.log",
allowed={0, 2},
)