Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from PIL import Image
|
| 4 |
+
from modules.thermal_fault_detection import detect_faults
|
| 5 |
+
|
| 6 |
+
st.set_page_config(page_title="Solar Panel Thermal Fault Detector", layout="centered")
|
| 7 |
+
st.title("π Solar Panel Thermal Fault Detection Dashboard")
|
| 8 |
+
|
| 9 |
+
st.markdown("""
|
| 10 |
+
This AI-powered app analyzes thermal images from drones to detect:
|
| 11 |
+
- π₯ Overheating
|
| 12 |
+
- π«οΈ Dust Accumulation
|
| 13 |
+
- π§ Physical Breakage
|
| 14 |
+
""")
|
| 15 |
+
|
| 16 |
+
uploaded_image = st.file_uploader("Upload a thermal image of a solar panel", type=["jpg", "png", "jpeg"])
|
| 17 |
+
|
| 18 |
+
if uploaded_image:
|
| 19 |
+
image = Image.open(uploaded_image)
|
| 20 |
+
st.image(image, caption="Uploaded Thermal Image", use_column_width=True)
|
| 21 |
+
|
| 22 |
+
with st.spinner("Analyzing for thermal faults..."):
|
| 23 |
+
results = detect_faults(image)
|
| 24 |
+
if results:
|
| 25 |
+
st.error("\n### β Faults Detected:")
|
| 26 |
+
for fault in results:
|
| 27 |
+
st.write(f"- π΄ **Fault Type:** {fault[0]} | **Confidence:** {fault[1]:.2f}")
|
| 28 |
+
else:
|
| 29 |
+
st.success("β
No faults detected.")
|