File size: 1,122 Bytes
3f7c605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
import gradio as gr

# ---- Overheat Detection Logic ----
def detect_overheat(temp, humidity, solar_output):
    """
    Detects overheat fault in a smart pole.
    Uses simple rule: if temperature > 50°C, flag as overheat.
    Future scope: Add ML model here (e.g., IsolationForest or AutoEncoder).
    """
    if temp > 50:
        return "🔥 Overheat Detected"
    else:
        return "✅ Normal"

# ---- Gradio Interface ----
interface = gr.Interface(
    fn=detect_overheat,
    inputs=[
        gr.Number(label="Temperature (°C)"),
        gr.Number(label="Humidity (%)"),
        gr.Number(label="Solar Output (Watts)")
    ],
    outputs=gr.Text(label="Fault Detection Result"),
    title="VIEP Overheat Detection - Smart Pole Fault Monitor",
    description=(
        "This tool detects overheating faults in Vedavathi Intelligent Energy Poles "
        "(VIEP) based on sensor readings from each pole. "
        "Enter temperature, humidity, and solar power output to check for overheating faults."
    ),
    theme="default"
)

# ---- Launch the App ----
if __name__ == "__main__":
    interface.launch()