File size: 987 Bytes
853c436
e082616
 
853c436
de165de
 
853c436
de165de
 
a2d5772
 
de165de
e082616
 
 
 
 
839d485
 
 
853c436
e082616
839d485
853c436
e082616
839d485
853c436
e082616
839d485
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import streamlit as st
import sys
import os

# ✅ Fix path for modules (MUST be done before importing from modules)
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

# ✅ Now import from modules
from modules.streamlit_ui import display_video_feed, display_alerts
from modules.fault_detection import detect_faults
from modules.ai_model import run_inference
from modules.utils import load_image  # If you're using image pre-processing

# Streamlit app logic
st.title("Solar Panel and Windmill Fault Monitoring System")

# Sidebar controls
st.sidebar.header("Simulation Controls")
num_assets = st.sidebar.slider("Number of Assets", min_value=5, max_value=50, value=10)
simulate_faults = st.sidebar.checkbox("Simulate Random Faults", value=True)

# Display live video feed
video_feed = display_video_feed()

# Process video feed for fault detection
faults = detect_faults(video_feed)

# Display fault alerts if detected
if faults:
    display_alerts(faults)