BUHARI1025 commited on
Commit
7872a50
·
verified ·
1 Parent(s): a5b3487

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -26
app.py CHANGED
@@ -1,49 +1,61 @@
1
  import streamlit as st
2
  import pandas as pd
3
-
4
- # 1. Page Config
5
- st.set_page_config(page_title="VISION-LINK AI Security OS", layout="wide")
6
-
7
- # 2. Sidebar Navigation
 
 
 
 
 
 
 
 
 
 
 
8
  with st.sidebar:
9
  st.title("🛡️ SECURITY OPS")
10
  menu = st.radio("Navigation", [
11
  "Operations Overview", "Camera Feeds", "Location Risk",
12
- "Incident Log", "Dispatch Center", "Evidence Archive",
13
- "Ultralytics HUB", "Live Detection", "Personal Safety"
14
  ])
15
  st.markdown("---")
16
  st.write("Status: System Active 🟢")
17
 
18
- # 3. Main Content Rendering
19
- # Wannan logic ɗin zai tabbatar da cewa duk lokacin da ka danna menu,
20
- # app ɗin zai nuna abin da ya dace ba tare da ɓacewa ba.
 
 
 
21
 
 
22
  if menu == "Operations Overview":
23
  st.header("Operations Overview")
24
  st.write("Welcome to the Command Center.")
25
- # Sanya abubuwan da kake so a nan
 
 
26
 
27
  elif menu == "Camera Feeds":
28
  st.header("📹 Camera Feeds")
29
- st.info("System checking camera connections...")
30
- # Sanya grid na cameras a nan
31
-
32
- elif menu == "Location Risk":
33
- st.header("📍 Location Risk Monitoring")
34
- st.success("GPS Tracking - ACTIVE")
35
- # Sanya map ko coordinate status a nan
36
-
37
- elif menu == "Incident Log":
38
- st.header("🚨 Incident Log")
39
- st.write("Displaying latest security logs...")
40
- # Sanya dataframe a nan
41
 
42
  elif menu == "Live Detection":
43
  st.header("⚡ Live AI Detection")
44
- st.warning("YOLOv8n Model: READY")
45
- # Sanya video feed placeholder a nan
 
 
 
 
 
 
 
46
 
47
  else:
48
  st.header(f"{menu}")
49
- st.write(f"Section for {menu} is currently under construction.")
 
1
  import streamlit as st
2
  import pandas as pd
3
+ import cv2
4
+ from gtts import gTTS
5
+ import os
6
+
7
+ # Page Setup
8
+ st.set_page_config(page_title="VISION-LINK OS", layout="wide")
9
+
10
+ # CSS don ya zama kamar Monday.com
11
+ st.markdown("""
12
+ <style>
13
+ .stApp { background-color: #f5f6f8; }
14
+ div[data-testid="stSidebar"] { background-color: #ffffff; border-right: 1px solid #e0e0e0; }
15
+ </style>
16
+ """, unsafe_allow_html=True)
17
+
18
+ # Sidebar Navigation
19
  with st.sidebar:
20
  st.title("🛡️ SECURITY OPS")
21
  menu = st.radio("Navigation", [
22
  "Operations Overview", "Camera Feeds", "Location Risk",
23
+ "Incident Log", "Dispatch Center", "Live Detection"
 
24
  ])
25
  st.markdown("---")
26
  st.write("Status: System Active 🟢")
27
 
28
+ # Logic don Voice Alert
29
+ def trigger_voice_alert(text):
30
+ tts = gTTS(text=text, lang='ha')
31
+ tts.save("alert.mp3")
32
+ # A cikin Streamlit, za mu iya amfani da st.audio don kunna sautin
33
+ st.audio("alert.mp3")
34
 
35
+ # Main Interface
36
  if menu == "Operations Overview":
37
  st.header("Operations Overview")
38
  st.write("Welcome to the Command Center.")
39
+ col1, col2 = st.columns(2)
40
+ col1.metric("Active Threats", "0")
41
+ col2.metric("Camera Status", "Online")
42
 
43
  elif menu == "Camera Feeds":
44
  st.header("📹 Camera Feeds")
45
+ st.info("Connecting to 20+ Camera Feeds...")
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  elif menu == "Live Detection":
48
  st.header("⚡ Live AI Detection")
49
+ if st.button("🚨 Trigger Test Alert"):
50
+ trigger_voice_alert("Gargadi, an gano barazana a yankin ku")
51
+
52
+ # Placeholder don Live Video
53
+ st.warning("YOLOv8n Model: Ready")
54
+
55
+ elif menu == "Location Risk":
56
+ st.header("📍 Location Risk Monitoring")
57
+ st.success("GPS Location Tracking - ACTIVE")
58
 
59
  else:
60
  st.header(f"{menu}")
61
+ st.write("System module is under construction.")