Spaces:
Build error
Build error
Download src/streamlit_app.py from DSatishchandra/Solar_Panels_Faults_Detection: direct link, hf CLI and curl.
- Browser
- Download file 987 Bytes
-
https://huggingface.co/spaces/DSatishchandra/Solar_Panels_Faults_Detection/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/DSatishchandra/Solar_Panels_Faults_Detection/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/DSatishchandra/Solar_Panels_Faults_Detection/resolve/main/src/streamlit_app.py
987 Bytes
| 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) | |