Spaces:
Sleeping
Sleeping
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() | |