File size: 1,973 Bytes
80e070e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | """
Patch extraction configuration for RockGlacierNet.
Edit values here to experiment with different patch sizes, strides,
and filtering without touching any other code.
"""
PATCH_CONFIG = {
# ββ Patch geometry ββββββββββββββββββββββββββββββββββββββββββββ
"patch_size": 64, # spatial size of each square patch (px)
"stride": 32, # step between patch origins (px); 32 = 50% overlap
# ββ Filtering βββββββββββββββββββββββββββββββββββββββββββββββββ
"background_keep_ratio": 0.25, # fraction of pure-background patches to keep
"minimum_glacier_percentage": 0.0, # keep all patches that have ANY glacier px
# ββ Padding βββββββββββββββββββββββββββββββββββββββββββββββββββ
"padding_mode": "reflect", # "reflect" | "constant" (0-fill)
# ββ Paths βββββββββββββββββββββββββββββββββββββββββββββββββββββ
"dataset_dir": "dataset", # source: dataset/{split}/features|masks
"output_dir": "patches", # dest: patches/{split}/features|masks
# ββ Other βββββββββββββββββββββββββββββββββββββββββββββββββββββ
"num_bands": 12,
"splits": ["train", "val", "test"],
"random_seed": 42,
}
# ββ Quick-experiment presets (swap into PATCH_CONFIG to test) βββββββ
PRESET_64_STRIDE64 = {**PATCH_CONFIG, "stride": 64}
PRESET_96_STRIDE48 = {**PATCH_CONFIG, "patch_size": 96, "stride": 48}
PRESET_64_NOSTRIDE = {**PATCH_CONFIG, "stride": 64} # non-overlapping
|