Download datapipeline/config.py from kabiriitb/rockglacierNET: direct link, hf CLI and curl.
- Browser
- Download file 2.67 kB
-
https://huggingface.co/kabiriitb/rockglacierNET/resolve/main/datapipeline/config.py
- Command line
-
hf download hf://kabiriitb/rockglacierNET/datapipeline/config.py
-
curl -L -o config.py https://huggingface.co/kabiriitb/rockglacierNET/resolve/main/datapipeline/config.py
2.67 kB
| """ | |
| Default configuration for the RockGlacierNet dataset-building pipeline. | |
| Everything here can be overridden on the command line in run_pipeline.py | |
| (--raster, --shp, --out, --patch, --stride). Paths are relative to the repo | |
| root unless absolute. | |
| Design choices baked in (from hard-won experience on earlier datasets): | |
| * features and masks are cropped from the SAME pixel window on the SAME grid | |
| -> feature/mask alignment is structurally guaranteed (no mismatch), | |
| * the mask is rasterised from ALL glaciers on the raster grid, so any | |
| neighbouring glacier inside a window is labelled (no label noise), | |
| * min_window = patch_size, so crops never need destructive up-padding | |
| (the bug that poisoned the first 30 m dataset), | |
| * NaN / no-data is imputed to the per-band TRAIN mean (normalises to ~0), | |
| * the train/val/test split is BY CROP, so overlapping patches never leak. | |
| """ | |
| DEFAULTS = { | |
| # ββ inputs ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| "raster": "35_band/band_feature", # a GeoTIFF/VRT file OR a folder | |
| "shp": "Final_merged01/Final_merged01.shp", | |
| "out": "all_data", # output root (git-ignored data) | |
| # ββ cropping ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| "padding_m": 200, # context buffer around each glacier bbox | |
| "background_ratio": 0.10, # pure-background crops as a fraction of dataset | |
| "min_valid_fraction": 0.6, # drop crops whose band-0 is >40% no-data | |
| "all_touched": True, # rasterise: keep any pixel a polygon touches | |
| # ββ patching (patch_size overridden by --patch) ββββββββββββββββββββββββββ | |
| "patch_size": 128, # 64, 128, ... (set per run) | |
| "stride": None, # None -> patch_size // 2 | |
| "min_glacier_pct": 1.0, # a patch counts as glacier above this % | |
| "background_keep_ratio": 0.10, # fraction of pure-bg patches to keep | |
| "padding_mode": "reflect", # feature AND mask padded identically | |
| # ββ split βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| "train_ratio": 0.70, | |
| "val_ratio": 0.15, | |
| "seed": 42, | |
| } | |