Freeze regional routes across release evaluation
This commit is contained in:
@@ -39,7 +39,7 @@ INFERENCE_CONFIG_FIELDS = (
|
|||||||
"max_detections_per_tile", "nms_iou", "containment_nms", "box_scale",
|
"max_detections_per_tile", "nms_iou", "containment_nms", "box_scale",
|
||||||
"box_offset_x", "box_offset_y", "additional_model", "ensemble_mode",
|
"box_offset_x", "box_offset_y", "additional_model", "ensemble_mode",
|
||||||
"ensemble_match_iou", "proposal_classifier", "proposal_classifier_threshold",
|
"ensemble_match_iou", "proposal_classifier", "proposal_classifier_threshold",
|
||||||
"proposal_crop_scale", "proposal_classifier_batch",
|
"proposal_crop_scale", "proposal_classifier_batch", "regional_models",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
from scripts.assess_belgium_building_training_iteration import (
|
||||||
|
INFERENCE_CONFIG_FIELDS,
|
||||||
|
assert_same_inference_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_regional_model_routes_are_frozen_in_inference_config() -> None:
|
||||||
|
assert "regional_models" in INFERENCE_CONFIG_FIELDS
|
||||||
|
calibration = {field: None for field in INFERENCE_CONFIG_FIELDS}
|
||||||
|
calibration["regional_models"] = {"flanders": "/models/flanders.pt"}
|
||||||
|
test = dict(calibration)
|
||||||
|
test["regional_models"] = {"flanders": "/models/other.pt"}
|
||||||
|
|
||||||
|
with pytest.raises(ValueError, match="regional_models"):
|
||||||
|
assert_same_inference_config(calibration, test, "test")
|
||||||
|
|
||||||
|
|
||||||
|
def test_regional_tile_counts_may_differ_between_splits() -> None:
|
||||||
|
calibration = {field: None for field in INFERENCE_CONFIG_FIELDS}
|
||||||
|
test = dict(calibration)
|
||||||
|
calibration["regional_model_tile_counts"] = {"flanders": 48}
|
||||||
|
test["regional_model_tile_counts"] = {"flanders": 64}
|
||||||
|
|
||||||
|
assert_same_inference_config(calibration, test, "test")
|
||||||
Reference in New Issue
Block a user