Update src/streamlit_app.py
Browse files- src/streamlit_app.py +17 -0
src/streamlit_app.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from PIL import Image
|
| 3 |
import time
|
|
@@ -6,6 +22,7 @@ import io
|
|
| 6 |
import matplotlib.pyplot as plt
|
| 7 |
import pandas as pd
|
| 8 |
|
|
|
|
| 9 |
# --- Page Config ---
|
| 10 |
st.set_page_config(page_title="Smart Traffic Light System", layout="wide")
|
| 11 |
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
# Set safe writable directories
|
| 4 |
+
os.environ["STREAMLIT_CONFIG_DIR"] = "/tmp/.streamlit"
|
| 5 |
+
os.environ["ULTRALYTICS_HUB_DIR"] = "/tmp/Ultralytics"
|
| 6 |
+
os.environ["MPLCONFIGDIR"] = "/tmp/matplotlib"
|
| 7 |
+
|
| 8 |
+
# Optional: Set YOLO config path
|
| 9 |
+
os.environ["YOLO_CONFIG_DIR"] = "/tmp/Ultralytics"
|
| 10 |
+
|
| 11 |
+
os.makedirs("/tmp/.streamlit", exist_ok=True)
|
| 12 |
+
os.makedirs("/tmp/Ultralytics", exist_ok=True)
|
| 13 |
+
os.makedirs("/tmp/matplotlib", exist_ok=True)
|
| 14 |
+
|
| 15 |
+
os.environ["STREAMLIT_USAGE_STATISTICS"] = "false"
|
| 16 |
+
|
| 17 |
import streamlit as st
|
| 18 |
from PIL import Image
|
| 19 |
import time
|
|
|
|
| 22 |
import matplotlib.pyplot as plt
|
| 23 |
import pandas as pd
|
| 24 |
|
| 25 |
+
|
| 26 |
# --- Page Config ---
|
| 27 |
st.set_page_config(page_title="Smart Traffic Light System", layout="wide")
|
| 28 |
|