Update streamlit_app.py
Browse files- streamlit_app.py +0 -23
streamlit_app.py
CHANGED
@@ -226,29 +226,6 @@ if page == "Distraction System":
|
|
226 |
except Exception as e:
|
227 |
st.error(f"Error handling video upload: {str(e)}")
|
228 |
|
229 |
-
# --- Feature: Real-time Drowsiness Detection (Only for local) ---
|
230 |
-
elif page == "Real-time Drowsiness Detection":
|
231 |
-
st.title("🧠 Real-time Drowsiness Detection")
|
232 |
-
|
233 |
-
if os.getenv("SPACE_ID"): # Running on Hugging Face Spaces
|
234 |
-
st.error("⚠️ Real-time webcam detection is not available in cloud deployment.")
|
235 |
-
st.info("This feature requires direct access to your camera and only works in local environments.")
|
236 |
-
st.markdown("""
|
237 |
-
**To use this feature:**
|
238 |
-
1. Download the code to your local machine
|
239 |
-
2. Install the required dependencies
|
240 |
-
3. Run the application locally with `streamlit run streamlit_app.py`
|
241 |
-
""")
|
242 |
-
else:
|
243 |
-
st.info("This feature requires a local webcam and will open a new window.")
|
244 |
-
st.warning("This feature is intended for local use and will not function in cloud deployment.")
|
245 |
-
if st.button("Start Drowsiness Detection"):
|
246 |
-
try:
|
247 |
-
subprocess.Popen(["python3", "drowsiness_detection.py", "--mode", "webcam"])
|
248 |
-
st.success("Attempted to launch detection window. Please check your desktop.")
|
249 |
-
except Exception as e:
|
250 |
-
st.error(f"Failed to start process: {e}")
|
251 |
-
|
252 |
# --- Feature: Video Drowsiness Detection ---
|
253 |
elif page == "Video Drowsiness Detection":
|
254 |
st.title("📹 Video Drowsiness Detection")
|
|
|
226 |
except Exception as e:
|
227 |
st.error(f"Error handling video upload: {str(e)}")
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
# --- Feature: Video Drowsiness Detection ---
|
230 |
elif page == "Video Drowsiness Detection":
|
231 |
st.title("📹 Video Drowsiness Detection")
|