Spaces:
Runtime error
Runtime error
Commit
·
46d9d34
0
Parent(s):
Duplicate from awacke1/MN.Map.Hospitals.Top.Five
Browse files- .gitattributes +34 -0
- README.md +14 -0
- app.py +54 -0
- backup.app.py +44 -0
- requirements.txt +5 -0
.gitattributes
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: MN.Map.Hospitals.Top.Five
|
| 3 |
+
emoji: 📊
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.17.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
duplicated_from: awacke1/MN.Map.Hospitals.Top.Five
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import folium
|
| 3 |
+
from streamlit_folium import folium_static
|
| 4 |
+
|
| 5 |
+
# Define hospitals data for Minnesota
|
| 6 |
+
hospitals = [('Mayo Clinic', 'Rochester', 44.023678, -92.466955),
|
| 7 |
+
('University of Minnesota Medical Center', 'Minneapolis', 44.971389, -93.240556),
|
| 8 |
+
('Hennepin County Medical Center', 'Minneapolis', 44.972078, -93.261769),
|
| 9 |
+
('Regions Hospital', 'St. Paul', 44.942936, -93.093457),
|
| 10 |
+
('Abbott Northwestern Hospital', 'Minneapolis', 44.955447, -93.268543)]
|
| 11 |
+
|
| 12 |
+
# Create a map centered on Minnesota
|
| 13 |
+
m = folium.Map(location=[45.0, -94.0], zoom_start=7)
|
| 14 |
+
|
| 15 |
+
# Add markers for each hospital
|
| 16 |
+
for hospital in hospitals:
|
| 17 |
+
folium.Marker(
|
| 18 |
+
location=[hospital[2], hospital[3]],
|
| 19 |
+
popup=f'{hospital[0]}<br>{hospital[1]}',
|
| 20 |
+
icon=folium.Icon(color='red')
|
| 21 |
+
).add_to(m)
|
| 22 |
+
|
| 23 |
+
# Add waypoints for each hospital
|
| 24 |
+
waypoints = [(hospital[2], hospital[3]) for hospital in hospitals]
|
| 25 |
+
folium.plugins.AntPath(waypoints, delay=3000).add_to(m)
|
| 26 |
+
|
| 27 |
+
# Function to update the map when a button is clicked
|
| 28 |
+
def update_map(hospital_data):
|
| 29 |
+
m.location = [hospital_data[2], hospital_data[3]]
|
| 30 |
+
m.zoom_start = 13
|
| 31 |
+
folium_static(m)
|
| 32 |
+
|
| 33 |
+
# Create a grid of buttons for selecting hospitals
|
| 34 |
+
col1, col2, col3 = st.columns(3)
|
| 35 |
+
with col1:
|
| 36 |
+
if st.button(hospitals[0][0]):
|
| 37 |
+
update_map(hospitals[0])
|
| 38 |
+
with col2:
|
| 39 |
+
if st.button(hospitals[1][0]):
|
| 40 |
+
update_map(hospitals[1])
|
| 41 |
+
with col3:
|
| 42 |
+
if st.button(hospitals[2][0]):
|
| 43 |
+
update_map(hospitals[2])
|
| 44 |
+
|
| 45 |
+
col4, col5, col6 = st.columns(3)
|
| 46 |
+
with col4:
|
| 47 |
+
if st.button(hospitals[3][0]):
|
| 48 |
+
update_map(hospitals[3])
|
| 49 |
+
with col5:
|
| 50 |
+
if st.button(hospitals[4][0]):
|
| 51 |
+
update_map(hospitals[4])
|
| 52 |
+
|
| 53 |
+
# Display the map in Streamlit
|
| 54 |
+
folium_static(m)
|
backup.app.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import folium
|
| 3 |
+
from streamlit_folium import folium_static
|
| 4 |
+
|
| 5 |
+
# Define hospitals data for Minnesota
|
| 6 |
+
hospitals = [('Mayo Clinic', 'Rochester', 44.023678, -92.466955), ('University of Minnesota Medical Center', 'Minneapolis', 44.971389, -93.240556), ('Hennepin County Medical Center', 'Minneapolis', 44.972078, -93.261769), ('Regions Hospital', 'St. Paul', 44.942936, -93.093457), ('Abbott Northwestern Hospital', 'Minneapolis', 44.955447, -93.268543)]
|
| 7 |
+
|
| 8 |
+
# Create a map centered on Minnesota
|
| 9 |
+
m = folium.Map(location=[45.0, -94.0], zoom_start=7)
|
| 10 |
+
|
| 11 |
+
# Add markers for each hospital
|
| 12 |
+
for hospital in hospitals:
|
| 13 |
+
folium.Marker(
|
| 14 |
+
location=[hospital[2], hospital[3]],
|
| 15 |
+
popup=f'{hospital[0]}<br>{hospital[1]}',
|
| 16 |
+
icon=folium.Icon(color='red')
|
| 17 |
+
).add_to(m)
|
| 18 |
+
|
| 19 |
+
# Add waypoints for each hospital
|
| 20 |
+
waypoints = [(hospital[2], hospital[3]) for hospital in hospitals]
|
| 21 |
+
folium.plugins.AntPath(waypoints, delay=3000).add_to(m)
|
| 22 |
+
|
| 23 |
+
# Display the map in Streamlit
|
| 24 |
+
folium_static(m)
|
| 25 |
+
|
| 26 |
+
# Create a grid of buttons for selecting hospitals
|
| 27 |
+
col1, col2, col3 = st.columns(3)
|
| 28 |
+
with col1:
|
| 29 |
+
if st.button(hospitals[0][0]):
|
| 30 |
+
m.location = [hospitals[0][2], hospitals[0][3]]
|
| 31 |
+
with col2:
|
| 32 |
+
if st.button(hospitals[1][0]):
|
| 33 |
+
m.location = [hospitals[1][2], hospitals[1][3]]
|
| 34 |
+
with col3:
|
| 35 |
+
if st.button(hospitals[2][0]):
|
| 36 |
+
m.location = [hospitals[2][2], hospitals[2][3]]
|
| 37 |
+
|
| 38 |
+
col4, col5, col6 = st.columns(3)
|
| 39 |
+
with col4:
|
| 40 |
+
if st.button(hospitals[3][0]):
|
| 41 |
+
m.location = [hospitals[3][2], hospitals[3][3]]
|
| 42 |
+
with col5:
|
| 43 |
+
if st.button(hospitals[4][0]):
|
| 44 |
+
m.location = [hospitals[4][2], hospitals[4][3]]
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
graphviz
|
| 3 |
+
pycountry
|
| 4 |
+
folium
|
| 5 |
+
streamlit-folium
|