-
Notifications
You must be signed in to change notification settings - Fork 2
Update Kraków UHI dataset implementation #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wkravchyk
wants to merge
4
commits into
WUR-AI:develop
Choose a base branch
from
wkravchyk:feature/uhi-krakow-update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2fbd1be
Update Kraków UHI dataset implementation to match changes from PR#125
wkravchyk 6dad72c
UHI Krakow config files and concept captions update
wkravchyk 36f9d51
UHI Krakow dataset definition file cleaning (use_unlabelled_data flag…
wkravchyk 73dfef0
Fix typos and leftover lines from debugging in Krakow dataset definit…
wkravchyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # Alignment data config for the Krakow LST use case (Tessera + expert-legend captions). | ||
| # | ||
| # Requirements before running: | ||
| # 1. The model-ready CSV the dataset loads from ${paths.data_dir} must contain the | ||
| # feat_* and aux_*_label columns. | ||
| # 2. Tessera tiles at ${paths.data_dir}/heat_krakow/eo/tessera/tessera_<name_loc>.npy | ||
| # (10x10, 128-band). | ||
| _target_: src.data.base_datamodule.BaseDataModule | ||
|
|
||
| dataset: | ||
| _target_: src.data.heat_krakow_dataset.HeatKrakowDataset | ||
| data_dir: ${paths.data_dir} | ||
| modalities: | ||
| tessera: | ||
| year: 2024 | ||
| size: 10 | ||
| format: npy | ||
| coords: {} | ||
| use_target_data: false | ||
| use_features: false | ||
| use_unlabelled_data: false | ||
| use_aux_data: | ||
| aux: | ||
| columns: | ||
| - target_lst | ||
| - feat_ndvi_20240829 | ||
| - feat_ndwi_20240829 | ||
| - feat_ari_20240829 | ||
| - feat_nbr_20240829 | ||
| - feat_meanbuildingsheight | ||
| - feat_buildingscoverha | ||
| - feat_buildingscoverpercent | ||
| - feat_copernicusmeanimperviousdensity2021 | ||
| - feat_res_per_1ha | ||
| - feat_dem_5m | ||
| - feat_slope_5m | ||
| - feat_aspect_5m | ||
| - feat_tpi_5m | ||
| - feat_tri_5m | ||
| - feat_annualsolarradiation | ||
| - feat_meancanopyheight | ||
| - feat_forestcoverha | ||
| - feat_forestcoverpercent | ||
| - feat_vegetationvoxelnumber | ||
| - feat_vegetationlidarptsnumber | ||
| - feat_hvv2bv | ||
| - feat_copernicusmeantreecoverdensity2023 | ||
| - feat_districtname__Bieńczyce | ||
| - feat_districtname__Bieżanów_Prokocim | ||
| - feat_districtname__Bronowice | ||
| - feat_districtname__Czyżyny | ||
| - feat_districtname__Dębniki | ||
| - feat_districtname__Grzegórzki | ||
| - feat_districtname__Krowodrza | ||
| - feat_districtname__Mistrzejowice | ||
| - feat_districtname__Nowa_Huta | ||
| - feat_districtname__Podgórze | ||
| - feat_districtname__Podgórze_Duchackie | ||
| - feat_districtname__Prądnik_Biały | ||
| - feat_districtname__Prądnik_Czerwony | ||
| - feat_districtname__Stare_Miasto | ||
| - feat_districtname__Swoszowice | ||
| - feat_districtname__Wzgórza_Krzesławickie | ||
| - feat_districtname__Zwierzyniec | ||
| - feat_districtname__Łagiewniki_Borek_Fałęcki | ||
| - feat_gridtype__industrial | ||
| - feat_gridtype__natural | ||
| - feat_gridtype__residential | ||
| - feat_gridtype__transport_infrastructure | ||
| - feat_griddominantlanduse__agriculture | ||
| - feat_griddominantlanduse__allotment_garden | ||
| - feat_griddominantlanduse__barren_land | ||
| - feat_griddominantlanduse__built_up_commercial | ||
| - feat_griddominantlanduse__built_up_industrial | ||
| - feat_griddominantlanduse__forest | ||
| - feat_griddominantlanduse__forest_nursery | ||
| - feat_griddominantlanduse__grove | ||
| - feat_griddominantlanduse__industrial | ||
| - feat_griddominantlanduse__low_vegetation | ||
| - feat_griddominantlanduse__multifamily_residential | ||
| - feat_griddominantlanduse__orchard | ||
| - feat_griddominantlanduse__other_built_up | ||
| - feat_griddominantlanduse__plantation | ||
| - feat_griddominantlanduse__residential | ||
| - feat_griddominantlanduse__river | ||
| - feat_griddominantlanduse__shrubland | ||
| - feat_griddominantlanduse__single_family_residential | ||
| - feat_griddominantlanduse__transport_infrastructure | ||
| - feat_griddominantlanduse__waterbodies | ||
| - feat_copernicusclcplusbackbone2023class__coniferous_forest | ||
| - feat_copernicusclcplusbackbone2023class__deciduous_forest | ||
| - feat_copernicusclcplusbackbone2023class__herbaceous_vegetation_permanent | ||
| - feat_copernicusclcplusbackbone2023class__herbaceous_vegetation_temporary | ||
| - feat_copernicusclcplusbackbone2023class__no_vegetation | ||
| - feat_copernicusclcplusbackbone2023class__sealed | ||
| - feat_copernicusclcplusbackbone2023class__shrubs | ||
| - feat_copernicusclcplusbackbone2023class__water | ||
| - feat_copernicusherbaceousvegpresence2023__herbaceous_vegetation_present | ||
| - feat_copernicusherbaceousvegpresence2023__no_herbaceous_vegetation | ||
| top: | ||
| columns: | ||
| - aux_ndvi_20240829_label | ||
| - aux_ndwi_20240829_label | ||
| - aux_ari_20240829_label | ||
| - aux_nbr_20240829_label | ||
| - aux_meanbuildingsheight_label | ||
| - aux_buildingscoverha_label | ||
| - aux_buildingscoverpercent_label | ||
| - aux_copernicusmeanimperviousdensity2021_label | ||
| - aux_res_per_1ha_label | ||
| - aux_dem_5m_label | ||
| - aux_slope_5m_label | ||
| - aux_aspect_5m_label | ||
| - aux_tpi_5m_label | ||
| - aux_tri_5m_label | ||
| - aux_annualsolarradiation_label | ||
| - aux_meancanopyheight_label | ||
| - aux_forestcoverha_label | ||
| - aux_forestcoverpercent_label | ||
| - aux_vegetationvoxelnumber_label | ||
| - aux_vegetationlidarptsnumber_label | ||
| - aux_hvv2bv_label | ||
| - aux_copernicusmeantreecoverdensity2023_label | ||
| - aux_districtid_label | ||
| - aux_districtname_label | ||
| - aux_gridtype_label | ||
| - aux_griddominantlanduse_label | ||
| - aux_copernicusclcplusbackbone2023class_label | ||
| - aux_copernicusherbaceousvegpresence2023_label | ||
| seed: ${seed} | ||
| cache_dir: ${paths.cache_dir} | ||
|
|
||
| caption_builder: | ||
| _target_: src.data.heat_krakow_caption_builder.HeatKrakowCaptionBuilder | ||
| templates_fname: v1.json | ||
| concepts_fname: v2.json | ||
| data_dir: ${paths.data_dir}/heat_krakow | ||
| seed: ${seed} | ||
|
|
||
| batch_size: 64 | ||
| num_workers: 8 | ||
| pin_memory: true | ||
|
|
||
| split_mode: "from_file" | ||
| saved_split_file_name: "heat_krakow_split_20260522_1120.pth" | ||
| seed: ${seed} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # @package _global_ | ||
|
|
||
| defaults: | ||
| - override /data: heat_krakow_tessera_text | ||
| - override /model: heat_krakow_tessera_alignment | ||
| - override /callbacks: default | ||
| - override /trainer: default | ||
|
|
||
| # Experiment identification | ||
| task_name: "heat_krakow_alignment" | ||
| tags: ["krakow", "lst", "tessera", "alignment"] | ||
|
|
||
| # Datamodule overrides | ||
| datamodule: | ||
| batch_size: 32 | ||
| num_workers: 4 | ||
|
|
||
| # Model parameters (Geo & Text Encoder Setup) | ||
| model: | ||
| optimizer: | ||
| _target_: torch.optim.AdamW | ||
| lr: 1e-4 | ||
| weight_decay: 0.01 | ||
|
|
||
| trainer: | ||
| min_epochs: 1 | ||
| max_epochs: 50 | ||
| accelerator: gpu | ||
| devices: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| _target_: src.models.text_alignment_model.TextAlignmentModel | ||
|
|
||
| geo_encoder: | ||
|
gabrieletijunaityte marked this conversation as resolved.
|
||
| _target_: src.models.components.geo_encoders.average_encoder.AverageEncoder | ||
| geo_data_name: tessera | ||
|
|
||
| text_encoder: | ||
| _target_: src.models.components.text_encoders.clip_text_encoder.ClipTextEncoder | ||
| hf_cache_dir: ${paths.huggingface_cache} | ||
|
|
||
| match_to_geo: false | ||
| trainable_modules: | ||
| - text_encoder.projector | ||
| - loss_fn.log_temp | ||
|
|
||
| metrics: null | ||
|
|
||
| optimizer: | ||
| _target_: torch.optim.Adam | ||
| _partial_: true | ||
| lr: 0.001 | ||
| weight_decay: 0.0 | ||
|
|
||
| scheduler: | ||
| _target_: torch.optim.lr_scheduler.ReduceLROnPlateau | ||
| _partial_: true | ||
| mode: min | ||
| factor: 0.1 | ||
| patience: 10 | ||
|
|
||
| loss_fn: | ||
| _target_: src.models.components.loss_fns.clip_loss.ClipLoss | ||
| temperature: 0.07 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| [ | ||
| { | ||
| "concept_caption": "Hot surface above the urban heat-stress limit", | ||
| "is_max": true, | ||
| "col": "target_lst" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas with abundant vegetation in good condition", | ||
| "is_max": true, | ||
| "col": "feat_ndvi_20240829" | ||
| }, | ||
| { | ||
| "concept_caption": "Healthy vegetation in moist environment", | ||
| "is_max": true, | ||
| "col": "feat_ndwi_20240829" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas covered with healthy, green vegetation", | ||
| "is_max": false, | ||
| "col": "feat_ari_20240829" | ||
| }, | ||
| { | ||
| "concept_caption": "Dense, healthy vegetation", | ||
| "is_max": true, | ||
| "col": "feat_nbr_20240829" | ||
| }, | ||
| { | ||
| "concept_caption": "High density of tall blocks of flats", | ||
| "is_max": true, | ||
| "col": "feat_meanbuildingsheight" | ||
| }, | ||
| { | ||
| "concept_caption": "Built-up areas with little or no green infrastructure", | ||
| "is_max": true, | ||
| "col": "feat_buildingscoverha" | ||
| }, | ||
| { | ||
| "concept_caption": "Built-up areas with little or no green infrastructure", | ||
| "is_max": true, | ||
| "col": "feat_buildingscoverpercent" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas fully covered with anthropogenic structures", | ||
| "is_max": true, | ||
| "col": "feat_copernicusmeanimperviousdensity2021" | ||
| }, | ||
| { | ||
| "concept_caption": "Sparsely populated areas, or areas without permanent residents", | ||
| "is_max": false, | ||
| "col": "feat_res_per_1ha" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas situated in the Vistula river valley", | ||
| "is_max": false, | ||
| "col": "feat_dem_5m" | ||
| }, | ||
| { | ||
| "concept_caption": "Steep slopes of natural or anthropogenic terrain features", | ||
| "is_max": true, | ||
| "col": "feat_slope_5m" | ||
| }, | ||
| { | ||
| "concept_caption": "Terrain features that rise above the neighbourhood", | ||
| "is_max": true, | ||
| "col": "feat_tpi_5m" | ||
| }, | ||
| { | ||
| "concept_caption": "Jagged terrain with uneven areas", | ||
| "is_max": true, | ||
| "col": "feat_tri_5m" | ||
| }, | ||
| { | ||
| "concept_caption": "High potential incoming solar radiation throughout the year", | ||
| "is_max": true, | ||
| "col": "feat_annualsolarradiation" | ||
| }, | ||
| { | ||
| "concept_caption": "Tall, dense forests", | ||
| "is_max": true, | ||
| "col": "feat_meancanopyheight" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas with no forest cover", | ||
| "is_max": false, | ||
| "col": "feat_forestcoverha" | ||
| }, | ||
| { | ||
| "concept_caption": "High vegetation volume and biomass", | ||
| "is_max": true, | ||
| "col": "feat_vegetationvoxelnumber" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas dominated by high vegetation with no buildings", | ||
| "is_max": true, | ||
| "col": "feat_hvv2bv" | ||
| }, | ||
| { | ||
| "concept_caption": "Areas covered with dense forests", | ||
| "is_max": true, | ||
| "col": "feat_copernicusmeantreecoverdensity2023" | ||
| } | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.