Add dated regional imagery training sources
This commit is contained in:
@@ -28,9 +28,9 @@ from app.models import Dataset # noqa: E402
|
||||
from normalize_belgium_building_labels import normalize # noqa: E402
|
||||
|
||||
REGION_SOURCES = {
|
||||
"flanders": ("digitaal_vlaanderen_orthophoto", "grb"),
|
||||
"wallonia": ("spw_orthophoto", "spw_picc"),
|
||||
"brussels": ("urbis_orthophoto", "urbis"),
|
||||
"flanders": ({"digitaal_vlaanderen_orthophoto"}, "grb"),
|
||||
"wallonia": ({"spw_orthophoto"}, "spw_picc"),
|
||||
"brussels": ({"urbis_orthophoto", "digitaal_vlaanderen_orthophoto"}, "urbis"),
|
||||
}
|
||||
SPLITS = {"train", "val", "calibration", "test", "background-test"}
|
||||
|
||||
@@ -56,8 +56,8 @@ def _validate_pair(sample: dict[str, Any], raster: Dataset, reference: Dataset)
|
||||
region = str(sample.get("region") or "").lower()
|
||||
if region not in REGION_SOURCES:
|
||||
raise SystemExit(f"Unsupported region for {sample.get('sample_slug')}: {region}")
|
||||
expected_raster, expected_reference = REGION_SOURCES[region]
|
||||
if raster.source_name != expected_raster:
|
||||
expected_rasters, expected_reference = REGION_SOURCES[region]
|
||||
if raster.source_name not in expected_rasters:
|
||||
raise SystemExit(f"Raster provider mismatch for {sample['sample_slug']}: {raster.source_name}")
|
||||
if reference.source_name != expected_reference or reference.reference_layer_name != "buildings":
|
||||
raise SystemExit(f"Reference provider/layer mismatch for {sample['sample_slug']}")
|
||||
@@ -156,6 +156,7 @@ def main() -> int:
|
||||
{
|
||||
"sample_slug": slug,
|
||||
"sample_role": sample.get("sample_role", "positive"),
|
||||
"require_empty": bool(sample.get("require_empty", False)),
|
||||
"region": region,
|
||||
"context": sample.get("context"),
|
||||
"split": sample["split"],
|
||||
|
||||
Reference in New Issue
Block a user