Simon Riezebos commited on
Commit
4470c81
Β·
1 Parent(s): 8a8004d

Implement huggingface dataset as storage

Browse files
app/Home.py CHANGED
@@ -6,7 +6,7 @@ from src.config_parameters import params
6
  # Page configuration
7
  st.set_page_config(layout="wide", page_title=params["browser_title"])
8
 
9
- from src.utils import (
10
  add_about,
11
  set_home_page_style,
12
  toggle_menu_button,
 
6
  # Page configuration
7
  st.set_page_config(layout="wide", page_title=params["browser_title"])
8
 
9
+ from src.utils import ( # noqa: E402
10
  add_about,
11
  set_home_page_style,
12
  toggle_menu_button,
app/pages/0_🌍_AOIs.py CHANGED
@@ -63,14 +63,14 @@ if radio_selection == "See Areas":
63
  "fillColor": "#3388ff",
64
  "color": "#3388ff",
65
  "fillOpacity": 0.2,
66
- "weight": 1
67
  },
68
  highlight_function=lambda x: {
69
  "fillColor": "#3388ff",
70
  "color": "#3388ff",
71
  "fillOpacity": 0.5,
72
- "weight": 3
73
- }
74
  )
75
  )
76
 
@@ -93,22 +93,25 @@ elif radio_selection == "Create New Area":
93
 
94
  # Add geocoder search bar
95
  from folium.plugins import Geocoder
 
96
  Geocoder(
97
  position="topleft",
98
  collapsed=True,
99
- add_marker=False, # ! Adding a marker messes up the area selection tool
100
- zoom=10
101
  ).add_to(folium_map)
102
 
103
  new_area_name = st.text_input("Area name")
104
-
105
  # Check if the name already exists
106
  existing_names = [aoi["name"] for aoi in st.session_state["all_aois"].values()]
107
  is_name_valid = new_area_name and new_area_name not in existing_names
108
-
109
  if new_area_name and not is_name_valid:
110
- st.error(f"An area with the name '{new_area_name}' already exists. Please choose a different name.")
111
-
 
 
112
  save_area = st.button("Save Area", disabled=not is_name_valid)
113
 
114
  st.session_state["prev_radio_selection"] = "Create New Area"
 
63
  "fillColor": "#3388ff",
64
  "color": "#3388ff",
65
  "fillOpacity": 0.2,
66
+ "weight": 1,
67
  },
68
  highlight_function=lambda x: {
69
  "fillColor": "#3388ff",
70
  "color": "#3388ff",
71
  "fillOpacity": 0.5,
72
+ "weight": 3,
73
+ },
74
  )
75
  )
76
 
 
93
 
94
  # Add geocoder search bar
95
  from folium.plugins import Geocoder
96
+
97
  Geocoder(
98
  position="topleft",
99
  collapsed=True,
100
+ add_marker=False, # ! Adding a marker messes up the area selection tool
101
+ zoom=10,
102
  ).add_to(folium_map)
103
 
104
  new_area_name = st.text_input("Area name")
105
+
106
  # Check if the name already exists
107
  existing_names = [aoi["name"] for aoi in st.session_state["all_aois"].values()]
108
  is_name_valid = new_area_name and new_area_name not in existing_names
109
+
110
  if new_area_name and not is_name_valid:
111
+ st.error(
112
+ f"An area with the name '{new_area_name}' already exists. Please choose a different name."
113
+ )
114
+
115
  save_area = st.button("Save Area", disabled=not is_name_valid)
116
 
117
  st.session_state["prev_radio_selection"] = "Create New Area"
app/pages/1_πŸ’§_Flood_extent_analysis.py CHANGED
@@ -1,8 +1,8 @@
1
  from datetime import date, timedelta
2
 
3
  import folium
4
- import pandas as pd
5
  import streamlit as st
 
6
  from src.config_parameters import params
7
  from src.gfm import (
8
  download_flood_product,
@@ -49,7 +49,7 @@ if "all_aois" not in st.session_state:
49
  st.session_state["all_aois"] = retrieve_all_aois()
50
 
51
  # If coming from a different page, all aois may be filled but not up to date, retrigger
52
- if st.session_state["prev_page"] != "flood_extent":
53
  st.session_state["all_aois"] = retrieve_all_aois()
54
 
55
  if "all_products" not in st.session_state:
@@ -109,7 +109,7 @@ if show_available_products:
109
  with col2_2:
110
  checkboxes = list()
111
  # Products are checked against the index to check whether they are already downloaded
112
- index_df = pd.read_csv("./output/index.csv")
113
  if st.session_state["all_products"]:
114
  for product in st.session_state["all_products"]:
115
  suffix = ""
@@ -133,7 +133,7 @@ with col5:
133
 
134
  # If the button is clicked download all checked products that have not been downloaded yet
135
  if download_products:
136
- index_df = pd.read_csv("./output/index.csv")
137
  for i, checkbox in enumerate(checkboxes):
138
  if checkbox:
139
  product_to_download = st.session_state["all_products"][i]
@@ -147,7 +147,7 @@ with col5:
147
  # For all the selected products add them to the map if they are available
148
  feature_groups = []
149
  if st.session_state["all_products"]:
150
- index_df = pd.read_csv("./output/index.csv")
151
  for i, checkbox in enumerate(checkboxes):
152
  if checkbox:
153
  product_id = st.session_state["all_products"][i]["product_id"]
 
1
  from datetime import date, timedelta
2
 
3
  import folium
 
4
  import streamlit as st
5
+ from src import hf_utils
6
  from src.config_parameters import params
7
  from src.gfm import (
8
  download_flood_product,
 
49
  st.session_state["all_aois"] = retrieve_all_aois()
50
 
51
  # If coming from a different page, all aois may be filled but not up to date, retrigger
52
+ if st.session_state.get("prev_page") != "flood_extent":
53
  st.session_state["all_aois"] = retrieve_all_aois()
54
 
55
  if "all_products" not in st.session_state:
 
109
  with col2_2:
110
  checkboxes = list()
111
  # Products are checked against the index to check whether they are already downloaded
112
+ index_df = hf_utils.get_geojson_index_df()
113
  if st.session_state["all_products"]:
114
  for product in st.session_state["all_products"]:
115
  suffix = ""
 
133
 
134
  # If the button is clicked download all checked products that have not been downloaded yet
135
  if download_products:
136
+ index_df = hf_utils.get_geojson_index_df()
137
  for i, checkbox in enumerate(checkboxes):
138
  if checkbox:
139
  product_to_download = st.session_state["all_products"][i]
 
147
  # For all the selected products add them to the map if they are available
148
  feature_groups = []
149
  if st.session_state["all_products"]:
150
+ index_df = hf_utils.get_geojson_index_df()
151
  for i, checkbox in enumerate(checkboxes):
152
  if checkbox:
153
  product_id = st.session_state["all_products"][i]["product_id"]
app/src/gfm.py CHANGED
@@ -5,13 +5,15 @@ from pathlib import Path
5
 
6
  import pandas as pd
7
  import requests
 
8
  from dotenv import load_dotenv
9
 
 
 
10
  load_dotenv()
11
 
12
 
13
- # TODO: These functions should be transformed into a proper class mainly to prevent authentication on each call
14
- # Authentication
15
  def get_gfm_user_and_token():
16
  username = os.environ["gfm_username"]
17
  password = os.environ["gfm_password"]
@@ -75,30 +77,35 @@ def download_flood_product(area_id, product, output_file_path=None):
75
  # Download and unzip file
76
  r = requests.get(download_link)
77
  buffer = io.BytesIO(r.content)
 
78
 
79
  with zipfile.ZipFile(buffer, "r") as z:
80
  namelist = z.namelist()
81
  for name in namelist:
82
  if "FLOOD" in name and ".geojson" in name:
83
  flood_filename = name
 
84
  break
85
- z.extract(flood_filename, output_file_path)
 
 
 
 
 
 
86
 
87
  df = pd.DataFrame(
88
  {
89
  "aoi_id": [area_id],
90
  "datetime": [product_time],
91
  "product": [product_id],
92
- "geojson_path": [output_file_path + "/" + flood_filename],
93
  }
94
  )
95
 
96
- index_file_path = Path(f"{output_file_path}/index.csv")
97
- if index_file_path.is_file():
98
- existing_df = pd.read_csv(index_file_path)
99
- df = pd.concat([existing_df, df])
100
-
101
- df.to_csv(index_file_path, index=False)
102
 
103
  print(f"Product {product_id} downloaded succesfully")
104
 
@@ -147,6 +154,7 @@ def create_aoi(new_area_name, coordinates):
147
  }
148
 
149
  r = requests.post(url=create_aoi_url, json=payload, headers=header)
 
150
  print("Posted new AOI")
151
 
152
 
@@ -163,4 +171,5 @@ def delete_aoi(aoi_id):
163
  print(delete_aoi_url)
164
 
165
  r = requests.delete(url=delete_aoi_url, headers=header)
 
166
  print("AOI deleted")
 
5
 
6
  import pandas as pd
7
  import requests
8
+ import streamlit as st
9
  from dotenv import load_dotenv
10
 
11
+ from src import hf_utils
12
+
13
  load_dotenv()
14
 
15
 
16
+ @st.cache_resource
 
17
  def get_gfm_user_and_token():
18
  username = os.environ["gfm_username"]
19
  password = os.environ["gfm_password"]
 
77
  # Download and unzip file
78
  r = requests.get(download_link)
79
  buffer = io.BytesIO(r.content)
80
+ hf_api = hf_utils.get_hf_api()
81
 
82
  with zipfile.ZipFile(buffer, "r") as z:
83
  namelist = z.namelist()
84
  for name in namelist:
85
  if "FLOOD" in name and ".geojson" in name:
86
  flood_filename = name
87
+ path_in_repo = f"flood-geojson/{flood_filename}"
88
  break
89
+ with z.open(flood_filename) as f:
90
+ hf_api.upload_file(
91
+ path_or_fileobj=f,
92
+ path_in_repo=path_in_repo,
93
+ repo_id="rodekruis/flood-mapping",
94
+ repo_type="dataset",
95
+ )
96
 
97
  df = pd.DataFrame(
98
  {
99
  "aoi_id": [area_id],
100
  "datetime": [product_time],
101
  "product": [product_id],
102
+ "path_in_repo": [path_in_repo],
103
  }
104
  )
105
 
106
+ index_df = hf_utils.get_geojson_index_df()
107
+ index_df = pd.concat([index_df, df], ignore_index=True)
108
+ hf_utils.update_geojson_index_df(index_df)
 
 
 
109
 
110
  print(f"Product {product_id} downloaded succesfully")
111
 
 
154
  }
155
 
156
  r = requests.post(url=create_aoi_url, json=payload, headers=header)
157
+ r.raise_for_status()
158
  print("Posted new AOI")
159
 
160
 
 
171
  print(delete_aoi_url)
172
 
173
  r = requests.delete(url=delete_aoi_url, headers=header)
174
+ r.raise_for_status()
175
  print("AOI deleted")
app/src/hf_utils.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import io
2
+
3
+ import pandas as pd
4
+ import streamlit as st
5
+ from huggingface_hub import HfApi
6
+
7
+
8
+ @st.cache_resource
9
+ def get_hf_api():
10
+ return HfApi()
11
+
12
+
13
+ @st.cache_resource
14
+ def get_geojson_index_df():
15
+ hf_api = get_hf_api()
16
+ try:
17
+ csv_path = hf_api.hf_hub_download(
18
+ repo_id="rodekruis/flood-mapping",
19
+ filename="index.csv",
20
+ repo_type="dataset",
21
+ force_download=True,
22
+ )
23
+ return pd.read_csv(csv_path)
24
+ except Exception as e:
25
+ st.warning(f"No index.csv found on Hugging Face: {e}")
26
+ return pd.DataFrame(columns=["aoi_id", "datetime", "product", "path_in_repo"])
27
+
28
+
29
+ def update_geojson_index_df(index_df: pd.DataFrame):
30
+ hf_api = get_hf_api()
31
+
32
+ write_buffer = io.BytesIO()
33
+ index_df.to_parquet(write_buffer, index=False)
34
+
35
+ hf_api.upload_file(
36
+ path_or_fileobj=write_buffer,
37
+ path_in_repo="index.parquet",
38
+ repo_id="rodekruis/flood-mapping",
39
+ repo_type="dataset",
40
+ )
41
+ get_geojson_index_df.clear()
app/src/utils.py CHANGED
@@ -4,9 +4,9 @@ import json
4
  import os
5
 
6
  import folium
7
- import pandas as pd
8
  import streamlit as st
9
 
 
10
  from src.config_parameters import params
11
 
12
 
@@ -157,16 +157,24 @@ def add_about():
157
  )
158
 
159
 
160
- def get_existing_flood_geojson(product_id, output_file_path="./output/"):
 
161
  """
162
  Getting a saved GFM flood geojson in an output folder of GFM files. Merge in one feature group if multiple.
163
  """
164
- index_df = pd.read_csv(output_file_path + "index.csv")
165
- geojson_path = index_df[index_df["product"] == product_id].geojson_path.values[0]
166
 
167
  # Combine multiple flood files into a FeatureGroup
168
  flood_geojson_group = folium.FeatureGroup(name=product_id)
169
 
 
 
 
 
 
 
 
170
  with open(geojson_path, "r") as f:
171
  geojson_data = json.load(f)
172
  flood_layer = folium.GeoJson(geojson_data)
 
4
  import os
5
 
6
  import folium
 
7
  import streamlit as st
8
 
9
+ from src import hf_utils
10
  from src.config_parameters import params
11
 
12
 
 
157
  )
158
 
159
 
160
+ @st.cache_resource
161
+ def get_existing_flood_geojson(product_id):
162
  """
163
  Getting a saved GFM flood geojson in an output folder of GFM files. Merge in one feature group if multiple.
164
  """
165
+ index_df = hf_utils.get_geojson_index_df()
166
+ path_in_repo = index_df[index_df["product"] == product_id].path_in_repo.values[0]
167
 
168
  # Combine multiple flood files into a FeatureGroup
169
  flood_geojson_group = folium.FeatureGroup(name=product_id)
170
 
171
+ hf_api = hf_utils.get_hf_api()
172
+ geojson_path = hf_api.hf_hub_download(
173
+ repo_id="rodekruis/flood-mapping",
174
+ path_in_repo=path_in_repo,
175
+ repo_type="dataset",
176
+ )
177
+
178
  with open(geojson_path, "r") as f:
179
  geojson_data = json.load(f)
180
  flood_layer = folium.GeoJson(geojson_data)
pyproject.toml CHANGED
@@ -11,5 +11,6 @@ dependencies = [
11
  "python-dotenv==1.0.1",
12
  "streamlit>=1.41.1",
13
  "streamlit-folium>=0.24.0",
14
- "ipykernel>=6.29.5"
 
15
  ]
 
11
  "python-dotenv==1.0.1",
12
  "streamlit>=1.41.1",
13
  "streamlit-folium>=0.24.0",
14
+ "ipykernel>=6.29.5",
15
+ "huggingface-hub>=0.30.2",
16
  ]
requirements.txt CHANGED
@@ -103,9 +103,15 @@ decorator==5.1.1 \
103
  executing==2.2.0 \
104
  --hash=sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa \
105
  --hash=sha256:5d108c028108fe2551d1a7b2e8b713341e2cb4fc0aa7dcf966fa4327a5226755
 
 
 
106
  folium==0.19.4 \
107
  --hash=sha256:431a655b52a9bf3efda336f2be022103f0106504a0599e7c349efbfd30bafda6 \
108
  --hash=sha256:bea5246b6a6aa61b96d1c51399dd63254bacbd6ba8a826eeb491f45242032dfd
 
 
 
109
  geopandas==1.0.1 \
110
  --hash=sha256:01e147d9420cc374d26f51fc23716ac307f32b49406e4bd8462c07e82ed1d3d6 \
111
  --hash=sha256:b8bf70a5534588205b7a56646e2082fb1de9a03599651b3d80c99ea4c2ca08ab
@@ -115,6 +121,9 @@ gitdb==4.0.12 \
115
  gitpython==3.1.44 \
116
  --hash=sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110 \
117
  --hash=sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269
 
 
 
118
  idna==3.10 \
119
  --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \
120
  --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3
@@ -388,6 +397,26 @@ pywin32==308 ; platform_python_implementation != 'PyPy' and sys_platform == 'win
388
  --hash=sha256:9b4de86c8d909aed15b7011182c8cab38c8850de36e6afb1f0db22b8959e3091 \
389
  --hash=sha256:ef313c46d4c18dfb82a2431e3051ac8f112ccee1a34f29c263c583c568db63cd \
390
  --hash=sha256:fd380990e792eaf6827fcb7e187b2b4b1cede0585e3d0c9e84201ec27b9905e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  pyzmq==26.2.1 \
392
  --hash=sha256:0250c94561f388db51fd0213cdccbd0b9ef50fd3c57ce1ac937bf3034d92d72e \
393
  --hash=sha256:099b56ef464bc355b14381f13355542e452619abb4c1e57a534b15a106bf8e23 \
@@ -520,6 +549,9 @@ tornado==6.4.2 \
520
  --hash=sha256:c36e62ce8f63409301537222faffcef7dfc5284f27eec227389f2ad11b09d946 \
521
  --hash=sha256:c82c46813ba483a385ab2a99caeaedf92585a1f90defb5693351fa7e4ea0bf73 \
522
  --hash=sha256:e828cce1123e9e44ae2a50a9de3055497ab1d0aeb440c5ac23064d9e44880da1
 
 
 
523
  traitlets==5.14.3 \
524
  --hash=sha256:9ed0579d3502c94b4b3732ac120375cda96f923114522847de4b3bb98b96b6b7 \
525
  --hash=sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f
 
103
  executing==2.2.0 \
104
  --hash=sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa \
105
  --hash=sha256:5d108c028108fe2551d1a7b2e8b713341e2cb4fc0aa7dcf966fa4327a5226755
106
+ filelock==3.18.0 \
107
+ --hash=sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2 \
108
+ --hash=sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de
109
  folium==0.19.4 \
110
  --hash=sha256:431a655b52a9bf3efda336f2be022103f0106504a0599e7c349efbfd30bafda6 \
111
  --hash=sha256:bea5246b6a6aa61b96d1c51399dd63254bacbd6ba8a826eeb491f45242032dfd
112
+ fsspec==2025.3.2 \
113
+ --hash=sha256:2daf8dc3d1dfa65b6aa37748d112773a7a08416f6c70d96b264c96476ecaf711 \
114
+ --hash=sha256:e52c77ef398680bbd6a98c0e628fbc469491282981209907bbc8aea76a04fdc6
115
  geopandas==1.0.1 \
116
  --hash=sha256:01e147d9420cc374d26f51fc23716ac307f32b49406e4bd8462c07e82ed1d3d6 \
117
  --hash=sha256:b8bf70a5534588205b7a56646e2082fb1de9a03599651b3d80c99ea4c2ca08ab
 
121
  gitpython==3.1.44 \
122
  --hash=sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110 \
123
  --hash=sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269
124
+ huggingface-hub==0.30.2 \
125
+ --hash=sha256:68ff05969927058cfa41df4f2155d4bb48f5f54f719dd0390103eefa9b191e28 \
126
+ --hash=sha256:9a7897c5b6fd9dad3168a794a8998d6378210f5b9688d0dfc180b1a228dc2466
127
  idna==3.10 \
128
  --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \
129
  --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3
 
397
  --hash=sha256:9b4de86c8d909aed15b7011182c8cab38c8850de36e6afb1f0db22b8959e3091 \
398
  --hash=sha256:ef313c46d4c18dfb82a2431e3051ac8f112ccee1a34f29c263c583c568db63cd \
399
  --hash=sha256:fd380990e792eaf6827fcb7e187b2b4b1cede0585e3d0c9e84201ec27b9905e4
400
+ pyyaml==6.0.2 \
401
+ --hash=sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48 \
402
+ --hash=sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133 \
403
+ --hash=sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484 \
404
+ --hash=sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5 \
405
+ --hash=sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc \
406
+ --hash=sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1 \
407
+ --hash=sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652 \
408
+ --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 \
409
+ --hash=sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8 \
410
+ --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476 \
411
+ --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \
412
+ --hash=sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b \
413
+ --hash=sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425 \
414
+ --hash=sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183 \
415
+ --hash=sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab \
416
+ --hash=sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725 \
417
+ --hash=sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e \
418
+ --hash=sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4 \
419
+ --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba
420
  pyzmq==26.2.1 \
421
  --hash=sha256:0250c94561f388db51fd0213cdccbd0b9ef50fd3c57ce1ac937bf3034d92d72e \
422
  --hash=sha256:099b56ef464bc355b14381f13355542e452619abb4c1e57a534b15a106bf8e23 \
 
549
  --hash=sha256:c36e62ce8f63409301537222faffcef7dfc5284f27eec227389f2ad11b09d946 \
550
  --hash=sha256:c82c46813ba483a385ab2a99caeaedf92585a1f90defb5693351fa7e4ea0bf73 \
551
  --hash=sha256:e828cce1123e9e44ae2a50a9de3055497ab1d0aeb440c5ac23064d9e44880da1
552
+ tqdm==4.67.1 \
553
+ --hash=sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2 \
554
+ --hash=sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2
555
  traitlets==5.14.3 \
556
  --hash=sha256:9ed0579d3502c94b4b3732ac120375cda96f923114522847de4b3bb98b96b6b7 \
557
  --hash=sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f
uv.lock CHANGED
@@ -219,6 +219,15 @@ wheels = [
219
  { url = "https://files.pythonhosted.org/packages/7b/8f/c4d9bafc34ad7ad5d8dc16dd1347ee0e507a52c3adb6bfa8887e1c6a26ba/executing-2.2.0-py2.py3-none-any.whl", hash = "sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa", size = 26702 },
220
  ]
221
 
 
 
 
 
 
 
 
 
 
222
  [[package]]
223
  name = "flood-mapping-gfm"
224
  version = "0.1.0"
@@ -226,6 +235,7 @@ source = { virtual = "." }
226
  dependencies = [
227
  { name = "folium" },
228
  { name = "geopandas" },
 
229
  { name = "ipykernel" },
230
  { name = "python-dotenv" },
231
  { name = "requests" },
@@ -237,6 +247,7 @@ dependencies = [
237
  requires-dist = [
238
  { name = "folium", specifier = ">=0.19.4" },
239
  { name = "geopandas", specifier = ">=1.0.1" },
 
240
  { name = "ipykernel", specifier = ">=6.29.5" },
241
  { name = "python-dotenv", specifier = "==1.0.1" },
242
  { name = "requests", specifier = ">=2.32.3" },
@@ -260,6 +271,15 @@ wheels = [
260
  { url = "https://files.pythonhosted.org/packages/fc/ab/d1f47c48a14e17cd487c8b467b573291fae75477b067241407e7889a3692/folium-0.19.4-py2.py3-none-any.whl", hash = "sha256:bea5246b6a6aa61b96d1c51399dd63254bacbd6ba8a826eeb491f45242032dfd", size = 110511 },
261
  ]
262
 
 
 
 
 
 
 
 
 
 
263
  [[package]]
264
  name = "geopandas"
265
  version = "1.0.1"
@@ -301,6 +321,24 @@ wheels = [
301
  { url = "https://files.pythonhosted.org/packages/1d/9a/4114a9057db2f1462d5c8f8390ab7383925fe1ac012eaa42402ad65c2963/GitPython-3.1.44-py3-none-any.whl", hash = "sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110", size = 207599 },
302
  ]
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  [[package]]
305
  name = "idna"
306
  version = "3.10"
@@ -882,6 +920,32 @@ wheels = [
882
  { url = "https://files.pythonhosted.org/packages/26/df/2b63e3e4f2df0224f8aaf6d131f54fe4e8c96400eb9df563e2aae2e1a1f9/pywin32-308-cp313-cp313-win_arm64.whl", hash = "sha256:ef313c46d4c18dfb82a2431e3051ac8f112ccee1a34f29c263c583c568db63cd", size = 7974986 },
883
  ]
884
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
  [[package]]
886
  name = "pyzmq"
887
  version = "26.2.1"
@@ -1151,6 +1215,18 @@ wheels = [
1151
  { url = "https://files.pythonhosted.org/packages/61/cc/58b1adeb1bb46228442081e746fcdbc4540905c87e8add7c277540934edb/tornado-6.4.2-cp38-abi3-win_amd64.whl", hash = "sha256:908b71bf3ff37d81073356a5fadcc660eb10c1476ee6e2725588626ce7e5ca38", size = 438907 },
1152
  ]
1153
 
 
 
 
 
 
 
 
 
 
 
 
 
1154
  [[package]]
1155
  name = "traitlets"
1156
  version = "5.14.3"
 
219
  { url = "https://files.pythonhosted.org/packages/7b/8f/c4d9bafc34ad7ad5d8dc16dd1347ee0e507a52c3adb6bfa8887e1c6a26ba/executing-2.2.0-py2.py3-none-any.whl", hash = "sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa", size = 26702 },
220
  ]
221
 
222
+ [[package]]
223
+ name = "filelock"
224
+ version = "3.18.0"
225
+ source = { registry = "https://pypi.org/simple" }
226
+ sdist = { url = "https://files.pythonhosted.org/packages/0a/10/c23352565a6544bdc5353e0b15fc1c563352101f30e24bf500207a54df9a/filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2", size = 18075 }
227
+ wheels = [
228
+ { url = "https://files.pythonhosted.org/packages/4d/36/2a115987e2d8c300a974597416d9de88f2444426de9571f4b59b2cca3acc/filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de", size = 16215 },
229
+ ]
230
+
231
  [[package]]
232
  name = "flood-mapping-gfm"
233
  version = "0.1.0"
 
235
  dependencies = [
236
  { name = "folium" },
237
  { name = "geopandas" },
238
+ { name = "huggingface-hub" },
239
  { name = "ipykernel" },
240
  { name = "python-dotenv" },
241
  { name = "requests" },
 
247
  requires-dist = [
248
  { name = "folium", specifier = ">=0.19.4" },
249
  { name = "geopandas", specifier = ">=1.0.1" },
250
+ { name = "huggingface-hub", specifier = ">=0.30.2" },
251
  { name = "ipykernel", specifier = ">=6.29.5" },
252
  { name = "python-dotenv", specifier = "==1.0.1" },
253
  { name = "requests", specifier = ">=2.32.3" },
 
271
  { url = "https://files.pythonhosted.org/packages/fc/ab/d1f47c48a14e17cd487c8b467b573291fae75477b067241407e7889a3692/folium-0.19.4-py2.py3-none-any.whl", hash = "sha256:bea5246b6a6aa61b96d1c51399dd63254bacbd6ba8a826eeb491f45242032dfd", size = 110511 },
272
  ]
273
 
274
+ [[package]]
275
+ name = "fsspec"
276
+ version = "2025.3.2"
277
+ source = { registry = "https://pypi.org/simple" }
278
+ sdist = { url = "https://files.pythonhosted.org/packages/45/d8/8425e6ba5fcec61a1d16e41b1b71d2bf9344f1fe48012c2b48b9620feae5/fsspec-2025.3.2.tar.gz", hash = "sha256:e52c77ef398680bbd6a98c0e628fbc469491282981209907bbc8aea76a04fdc6", size = 299281 }
279
+ wheels = [
280
+ { url = "https://files.pythonhosted.org/packages/44/4b/e0cfc1a6f17e990f3e64b7d941ddc4acdc7b19d6edd51abf495f32b1a9e4/fsspec-2025.3.2-py3-none-any.whl", hash = "sha256:2daf8dc3d1dfa65b6aa37748d112773a7a08416f6c70d96b264c96476ecaf711", size = 194435 },
281
+ ]
282
+
283
  [[package]]
284
  name = "geopandas"
285
  version = "1.0.1"
 
321
  { url = "https://files.pythonhosted.org/packages/1d/9a/4114a9057db2f1462d5c8f8390ab7383925fe1ac012eaa42402ad65c2963/GitPython-3.1.44-py3-none-any.whl", hash = "sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110", size = 207599 },
322
  ]
323
 
324
+ [[package]]
325
+ name = "huggingface-hub"
326
+ version = "0.30.2"
327
+ source = { registry = "https://pypi.org/simple" }
328
+ dependencies = [
329
+ { name = "filelock" },
330
+ { name = "fsspec" },
331
+ { name = "packaging" },
332
+ { name = "pyyaml" },
333
+ { name = "requests" },
334
+ { name = "tqdm" },
335
+ { name = "typing-extensions" },
336
+ ]
337
+ sdist = { url = "https://files.pythonhosted.org/packages/df/22/8eb91736b1dcb83d879bd49050a09df29a57cc5cd9f38e48a4b1c45ee890/huggingface_hub-0.30.2.tar.gz", hash = "sha256:9a7897c5b6fd9dad3168a794a8998d6378210f5b9688d0dfc180b1a228dc2466", size = 400868 }
338
+ wheels = [
339
+ { url = "https://files.pythonhosted.org/packages/93/27/1fb384a841e9661faad1c31cbfa62864f59632e876df5d795234da51c395/huggingface_hub-0.30.2-py3-none-any.whl", hash = "sha256:68ff05969927058cfa41df4f2155d4bb48f5f54f719dd0390103eefa9b191e28", size = 481433 },
340
+ ]
341
+
342
  [[package]]
343
  name = "idna"
344
  version = "3.10"
 
920
  { url = "https://files.pythonhosted.org/packages/26/df/2b63e3e4f2df0224f8aaf6d131f54fe4e8c96400eb9df563e2aae2e1a1f9/pywin32-308-cp313-cp313-win_arm64.whl", hash = "sha256:ef313c46d4c18dfb82a2431e3051ac8f112ccee1a34f29c263c583c568db63cd", size = 7974986 },
921
  ]
922
 
923
+ [[package]]
924
+ name = "pyyaml"
925
+ version = "6.0.2"
926
+ source = { registry = "https://pypi.org/simple" }
927
+ sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631 }
928
+ wheels = [
929
+ { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873 },
930
+ { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302 },
931
+ { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154 },
932
+ { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223 },
933
+ { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542 },
934
+ { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164 },
935
+ { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611 },
936
+ { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591 },
937
+ { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338 },
938
+ { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309 },
939
+ { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679 },
940
+ { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428 },
941
+ { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361 },
942
+ { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523 },
943
+ { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660 },
944
+ { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597 },
945
+ { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527 },
946
+ { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446 },
947
+ ]
948
+
949
  [[package]]
950
  name = "pyzmq"
951
  version = "26.2.1"
 
1215
  { url = "https://files.pythonhosted.org/packages/61/cc/58b1adeb1bb46228442081e746fcdbc4540905c87e8add7c277540934edb/tornado-6.4.2-cp38-abi3-win_amd64.whl", hash = "sha256:908b71bf3ff37d81073356a5fadcc660eb10c1476ee6e2725588626ce7e5ca38", size = 438907 },
1216
  ]
1217
 
1218
+ [[package]]
1219
+ name = "tqdm"
1220
+ version = "4.67.1"
1221
+ source = { registry = "https://pypi.org/simple" }
1222
+ dependencies = [
1223
+ { name = "colorama", marker = "sys_platform == 'win32'" },
1224
+ ]
1225
+ sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737 }
1226
+ wheels = [
1227
+ { url = "https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2", size = 78540 },
1228
+ ]
1229
+
1230
  [[package]]
1231
  name = "traitlets"
1232
  version = "5.14.3"