heatmap_advance / app.py
Sanjayraju30's picture
Update app.py
3c9495b verified
raw
history blame
1.26 kB
import streamlit as st
import pandas as pd
from modules.simulator import simulate_data
from modules.filters import apply_filters
from modules.visuals import display_dashboard, display_charts, display_map_with_alerts
from modules.ai_engine import AIEngine
st.set_page_config(page_title="Vedavathi Smart Pole Monitoring", layout="wide")
st.title("πŸ“‘ Vedavathi Smart Pole Monitoring - Heatmap AI Simulator")
# Sidebar Controls
st.sidebar.header("πŸ› οΈ Simulation Controls")
num_poles = st.sidebar.slider("Number of Poles", min_value=10, max_value=500, value=50)
simulate_faults = st.sidebar.checkbox("Simulate Random Faults", value=True)
# Simulate Data
df = simulate_data(num_poles, simulate_faults)
# AI-based Health Prediction
ai = AIEngine()
df = ai.predict_health(df)
# Sidebar Filters
st.sidebar.header("πŸ“‚ Filter Data")
alert_filter = st.sidebar.multiselect("Alert Level", ["Green", "Yellow", "Red"], default=["Green", "Yellow", "Red"])
cam_filter = st.sidebar.selectbox("Camera Status", ["All", "Online", "Offline"], index=0)
df = apply_filters(df, alert_filter, cam_filter)
# Dashboard UI
display_dashboard(df)
st.subheader("πŸ“ Live Pole Map")
display_map_with_alerts(df)
st.subheader("πŸ“ˆ Energy + Sensor Charts")
display_charts(df)