Tigernawin commited on
Commit
73ec66c
Β·
verified Β·
1 Parent(s): 8d944df

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
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.")