Managed validation / full (pull_request) Successful in 18s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Successful in 2m56s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 24s
GeoIntel release gates / GIS image, SBOM and container scan (pull_request) Failing after 54s
58 lines
3.0 KiB
Python
58 lines
3.0 KiB
Python
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def test_detection_lab_has_guided_threshold_calibration_runner() -> None:
|
|
hook = ROOT / "frontend" / "src" / "hooks" / "useDetectionWorkflow.ts"
|
|
lab = ROOT / "frontend" / "src" / "components" / "detection" / "DetectionLab.tsx"
|
|
app = ROOT / "frontend" / "src" / "WorkbenchApp.tsx"
|
|
todo = ROOT / "docs" / "TODO.md"
|
|
|
|
hook_source = hook.read_text(encoding="utf-8")
|
|
lab_source = lab.read_text(encoding="utf-8")
|
|
app_source = app.read_text(encoding="utf-8")
|
|
todo_source = todo.read_text(encoding="utf-8")
|
|
|
|
assert "interface DetectionCalibrationRunRow" in hook_source
|
|
assert "parseCalibrationThresholds" in hook_source
|
|
assert "calibrationThresholdText" in hook_source
|
|
assert "runningDetectionCalibration" in hook_source
|
|
assert "detectionCalibrationRows" in hook_source
|
|
assert "detectionCalibrationError" in hook_source
|
|
assert "runDetectionCalibration" in hook_source
|
|
assert "detectionApi.runAsync(request)" in hook_source
|
|
# Every requested threshold is reported, but from one inference pass at the
|
|
# lowest cut: detections above a higher cut are a subset of it, and
|
|
# suppression walks candidates in descending confidence, so the kept set
|
|
# above a cut does not depend on the threshold the run used. Asserting the
|
|
# old per-threshold loop pinned N GPU passes that produced identical numbers.
|
|
assert "lowestThreshold," in hook_source
|
|
assert "calibration_thresholds: thresholds" in hook_source
|
|
assert "calibration_sweep" in hook_source
|
|
assert "{ calibration: true, calibration_thresholds: thresholds }," in hook_source
|
|
assert "detectionApi.compareWithReference(result.analysis_run_id" in hook_source
|
|
assert "reference_dataset_id: referenceDatasetId" in hook_source
|
|
assert "Kies eerst een referentiebron om te kalibreren" in hook_source
|
|
assert "Geef minstens één geldige drempel tussen 0 en 1 op" in hook_source
|
|
assert "Kalibratie met YOLO vereist een beeldtegelmanifest" in hook_source
|
|
assert "Kies eerst een lokaal modelbestand om te kalibreren" in hook_source
|
|
|
|
assert "Modelkalibratie voor beheerders" in lab_source
|
|
assert "Voert het lokale model en een kwaliteitscontrole uit" in lab_source
|
|
assert "Zekerheidsdrempels" in lab_source
|
|
assert "Drempels vergelijken" in lab_source
|
|
assert "Voortgang modelkalibratie" in lab_source
|
|
assert "detectionCalibrationRows.map" in lab_source
|
|
assert "runningDetectionCalibration" in lab_source
|
|
assert "detectionCalibrationError" in lab_source
|
|
assert "onRunCalibration" in lab_source
|
|
assert "onSetCalibrationThresholdText" in lab_source
|
|
|
|
assert "calibrationThresholdText={calibrationThresholdText}" in app_source
|
|
assert "runningDetectionCalibration={runningDetectionCalibration}" in app_source
|
|
assert "detectionCalibrationRows={detectionCalibrationRows}" in app_source
|
|
assert "onRunCalibration={runDetectionCalibration}" in app_source
|
|
assert "[x] Add guided in-app detection calibration runner" in todo_source
|