Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
@@ -9,7 +9,7 @@ from ultralytics import YOLO
|
|
9 |
import cv2 as cv
|
10 |
import pandas as pd
|
11 |
|
12 |
-
model_path="
|
13 |
|
14 |
# --- Page Configuration ---
|
15 |
st.set_page_config(
|
@@ -254,7 +254,7 @@ elif page == "Real-time Drowsiness Detection":
|
|
254 |
st.write("This will open your webcam and run the detection script.")
|
255 |
if st.button("Start Drowsiness Detection"):
|
256 |
with st.spinner("Launching webcam..."):
|
257 |
-
subprocess.Popen(["python3", "
|
258 |
st.success("Drowsiness detection started in a separate window. Press 'q' in that window to quit.")
|
259 |
|
260 |
# --- Feature: Video Drowsiness Detection ---
|
@@ -273,7 +273,7 @@ elif page == "Video Drowsiness Detection":
|
|
273 |
progress_bar = st.progress(0, text="Preparing to process video...")
|
274 |
with st.spinner("Processing video... This may take a while."):
|
275 |
process = subprocess.Popen([
|
276 |
-
"python3", "
|
277 |
"--mode", "video",
|
278 |
"--input", temp_input_path,
|
279 |
"--output", temp_output_path
|
|
|
9 |
import cv2 as cv
|
10 |
import pandas as pd
|
11 |
|
12 |
+
model_path="best.pt"
|
13 |
|
14 |
# --- Page Configuration ---
|
15 |
st.set_page_config(
|
|
|
254 |
st.write("This will open your webcam and run the detection script.")
|
255 |
if st.button("Start Drowsiness Detection"):
|
256 |
with st.spinner("Launching webcam..."):
|
257 |
+
subprocess.Popen(["python3", "drowsiness_detection.py", "--mode", "webcam"])
|
258 |
st.success("Drowsiness detection started in a separate window. Press 'q' in that window to quit.")
|
259 |
|
260 |
# --- Feature: Video Drowsiness Detection ---
|
|
|
273 |
progress_bar = st.progress(0, text="Preparing to process video...")
|
274 |
with st.spinner("Processing video... This may take a while."):
|
275 |
process = subprocess.Popen([
|
276 |
+
"python3", "drowsiness_detection.py",
|
277 |
"--mode", "video",
|
278 |
"--input", temp_input_path,
|
279 |
"--output", temp_output_path
|