Download preprocess/patch_config.py from kabiriitb/rockglacierNET: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/kabiriitb/rockglacierNET/resolve/main/preprocess/patch_config.py
- Command line
-
hf download hf://kabiriitb/rockglacierNET/preprocess/patch_config.py
-
curl -L -o patch_config.py https://huggingface.co/kabiriitb/rockglacierNET/resolve/main/preprocess/patch_config.py
1.97 kB
| """ | |
| 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 | |