Add Mol multi-zone operational validation
This commit is contained in:
@@ -34,6 +34,15 @@ SMALL_BUILDING_TRAINING_SAMPLE_SLUGS = frozenset(
|
||||
SMALL_BUILDING_VALIDATION_SAMPLE_SLUGS = frozenset(
|
||||
{"vosselaar_center", "grobbendonk_center"}
|
||||
)
|
||||
MOL_OPERATIONAL_SAMPLE_SLUGS = (
|
||||
"mol",
|
||||
"mol_achterbos",
|
||||
"mol_gompel",
|
||||
"mol_donk",
|
||||
"mol_postel",
|
||||
)
|
||||
MOL_OPERATIONAL_VALIDATION_SAMPLE_SLUGS = frozenset(MOL_OPERATIONAL_SAMPLE_SLUGS[1:])
|
||||
MOL_BACKGROUND_CONTROL_SAMPLE_SLUGS = ("postel_bos",)
|
||||
DEFAULT_VALIDATION_SAMPLE_SLUGS = frozenset(
|
||||
{
|
||||
"turnhout",
|
||||
@@ -41,6 +50,7 @@ DEFAULT_VALIDATION_SAMPLE_SLUGS = frozenset(
|
||||
"westerlo",
|
||||
"arendonk_heide",
|
||||
*SMALL_BUILDING_VALIDATION_SAMPLE_SLUGS,
|
||||
*MOL_OPERATIONAL_VALIDATION_SAMPLE_SLUGS,
|
||||
}
|
||||
)
|
||||
requests: Any = None
|
||||
@@ -61,6 +71,8 @@ class OperatorSample:
|
||||
height: int = 512
|
||||
sample_role: str = "reference"
|
||||
allow_empty_reference: bool = False
|
||||
municipality: str | None = None
|
||||
operational_zone: str = "regional_reference"
|
||||
|
||||
|
||||
SAMPLES: dict[str, OperatorSample] = {
|
||||
@@ -69,6 +81,40 @@ SAMPLES: dict[str, OperatorSample] = {
|
||||
display_name="Mol center",
|
||||
center_lon=5.1167,
|
||||
center_lat=51.1919,
|
||||
municipality="Mol",
|
||||
operational_zone="center",
|
||||
),
|
||||
"mol_achterbos": OperatorSample(
|
||||
slug="mol_achterbos",
|
||||
display_name="Mol Achterbos residential",
|
||||
center_lon=5.0979785,
|
||||
center_lat=51.2008032,
|
||||
municipality="Mol",
|
||||
operational_zone="residential",
|
||||
),
|
||||
"mol_gompel": OperatorSample(
|
||||
slug="mol_gompel",
|
||||
display_name="Mol Gompel mixed settlement",
|
||||
center_lon=5.1502009,
|
||||
center_lat=51.1927937,
|
||||
municipality="Mol",
|
||||
operational_zone="mixed_settlement",
|
||||
),
|
||||
"mol_donk": OperatorSample(
|
||||
slug="mol_donk",
|
||||
display_name="Mol Donk canal and industrial context",
|
||||
center_lon=5.1126881,
|
||||
center_lat=51.2179802,
|
||||
municipality="Mol",
|
||||
operational_zone="canal_industrial",
|
||||
),
|
||||
"mol_postel": OperatorSample(
|
||||
slug="mol_postel",
|
||||
display_name="Mol Postel rural village",
|
||||
center_lon=5.1897863,
|
||||
center_lat=51.2874865,
|
||||
municipality="Mol",
|
||||
operational_zone="rural_village",
|
||||
),
|
||||
"geel": OperatorSample(
|
||||
slug="geel",
|
||||
@@ -178,6 +224,8 @@ SAMPLES: dict[str, OperatorSample] = {
|
||||
half_size_m=260.0,
|
||||
sample_role="background_candidate",
|
||||
allow_empty_reference=True,
|
||||
municipality="Mol",
|
||||
operational_zone="forest_background",
|
||||
),
|
||||
"lommel_heide": OperatorSample(
|
||||
slug="lommel_heide",
|
||||
@@ -561,6 +609,8 @@ def fetch_reference(
|
||||
reference["bbox"] = geo_bbox
|
||||
reference["sample_slug"] = sample.slug
|
||||
reference["sample_role"] = sample.sample_role
|
||||
reference["municipality"] = sample.municipality
|
||||
reference["operational_zone"] = sample.operational_zone
|
||||
reference["allow_empty_reference"] = sample.allow_empty_reference
|
||||
reference["background_category"] = background_category_for_sample(sample, len(features))
|
||||
reference["recommended_split"] = recommended_split_for_sample(sample)
|
||||
@@ -577,6 +627,8 @@ def fetch_reference(
|
||||
props.setdefault("reference_layer_name", "buildings")
|
||||
props.setdefault("sample_slug", sample.slug)
|
||||
props.setdefault("sample_role", sample.sample_role)
|
||||
props.setdefault("municipality", sample.municipality)
|
||||
props.setdefault("operational_zone", sample.operational_zone)
|
||||
props.setdefault("background_category", background_category_for_sample(sample, len(features)))
|
||||
props.setdefault("recommended_split", recommended_split_for_sample(sample))
|
||||
|
||||
@@ -619,6 +671,8 @@ def prepare_sample(
|
||||
"width": sample.width,
|
||||
"height": sample.height,
|
||||
"sample_role": sample.sample_role,
|
||||
"municipality": sample.municipality,
|
||||
"operational_zone": sample.operational_zone,
|
||||
"allow_empty_reference": sample.allow_empty_reference,
|
||||
"background_category": background_category,
|
||||
"recommended_split": recommended_split_for_sample(sample),
|
||||
@@ -657,6 +711,7 @@ def write_readme(output_dir: Path, samples: list[dict[str, Any]]) -> None:
|
||||
f"- `{sample['sample_slug']}`: `{Path(sample['raster_path']).name}` and "
|
||||
f"`{Path(sample['reference_path']).name}`, "
|
||||
f"{sample['reference_feature_count']} reference features, role `{sample['sample_role']}`, "
|
||||
f"municipality `{sample['municipality'] or 'regional'}`, zone `{sample['operational_zone']}`, "
|
||||
f"background category `{sample['background_category']}`, "
|
||||
f"recommended split `{sample['recommended_split']}`."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user