fouadmahmoud283-ai commited on
Commit
36a5118
·
1 Parent(s): 8b64662

Fix demo buttons and file upload issues - increased upload size and disabled CORS

Browse files
Files changed (2) hide show
  1. .streamlit/config.toml +14 -0
  2. src/streamlit_app.py +21 -21
.streamlit/config.toml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [server]
2
+ maxUploadSize = 200
3
+ enableCORS = false
4
+ enableXsrfProtection = false
5
+
6
+ [browser]
7
+ gatherUsageStats = false
8
+
9
+ [theme]
10
+ primaryColor = "#2E86AB"
11
+ backgroundColor = "#FFFFFF"
12
+ secondaryBackgroundColor = "#F0F2F6"
13
+ textColor = "#262730"
14
+ font = "sans serif"
src/streamlit_app.py CHANGED
@@ -26,7 +26,11 @@ st.set_page_config(
26
  page_title="🦽 AI Wheelchair Navigation System",
27
  page_icon="🦽",
28
  layout="wide",
29
- initial_sidebar_state="expanded"
 
 
 
 
30
  )
31
 
32
  # Custom CSS for wheelchair theme
@@ -342,28 +346,24 @@ def main():
342
 
343
  with col1:
344
  st.markdown("### 📷 Upload Image for Detection")
345
- uploaded_file = st.file_uploader(
346
- "Choose an image...",
347
- type=['jpg', 'jpeg', 'png'],
348
- help="Upload an image to test wheelchair navigation detection"
349
- )
350
-
351
- # Demo images
352
- st.markdown("### 🎬 Try Demo Images")
353
- demo_col1, demo_col2, demo_col3 = st.columns(3)
354
 
355
- with demo_col1:
356
- if st.button("🏪 Indoor Scene"):
357
- # You would replace this with actual demo images
358
- st.info("Demo: Indoor navigation scenario")
359
-
360
- with demo_col2:
361
- if st.button("🏙️ Outdoor Scene"):
362
- st.info("Demo: Outdoor navigation scenario")
363
 
364
- with demo_col3:
365
- if st.button("🚶 Crowded Area"):
366
- st.info("Demo: Crowded area navigation")
 
 
 
 
 
 
 
367
 
368
  with col2:
369
  st.markdown("### 🛡️ Safety Status")
 
26
  page_title="🦽 AI Wheelchair Navigation System",
27
  page_icon="🦽",
28
  layout="wide",
29
+ initial_sidebar_state="expanded",
30
+ menu_items={
31
+ 'Get Help': 'https://huggingface.co/spaces/fouadmahmoud281/processing-image',
32
+ 'About': 'AI Wheelchair Navigation System - Graduation Project'
33
+ }
34
  )
35
 
36
  # Custom CSS for wheelchair theme
 
346
 
347
  with col1:
348
  st.markdown("### 📷 Upload Image for Detection")
 
 
 
 
 
 
 
 
 
349
 
350
+ # Option to use demo or upload
351
+ demo_option = st.radio(
352
+ "Choose input method:",
353
+ ["Upload Image", "Use Demo (Coming Soon)"],
354
+ horizontal=True
355
+ )
 
 
356
 
357
+ uploaded_file = None
358
+ if demo_option == "Upload Image":
359
+ uploaded_file = st.file_uploader(
360
+ "Choose an image...",
361
+ type=['jpg', 'jpeg', 'png', 'bmp'],
362
+ help="Upload an image to test wheelchair navigation detection. Max size: 200MB",
363
+ key="image_uploader"
364
+ )
365
+ else:
366
+ st.info("📌 Demo images feature coming soon! Please use 'Upload Image' option for now.")
367
 
368
  with col2:
369
  st.markdown("### 🛡️ Safety Status")