File size: 1,143 Bytes
73ec66c
 
379778d
73ec66c
 
 
 
 
 
 
 
 
 
 
f2ce2fd
73ec66c
 
cd4bf3c
73ec66c
 
 
cd4bf3c
 
73ec66c
cd4bf3c
73ec66c
 
cd4bf3c
73ec66c
 
cd4bf3c
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
import streamlit as st
from PIL import Image
from modules.thermal_fault_detection import detect_faults

st.set_page_config(page_title="Solar Panel Thermal Fault Detector", layout="centered")
st.title("πŸ” Solar Panel Thermal Fault Detection Dashboard")

st.markdown("""
This AI-powered app analyzes thermal images from drones to detect:
- πŸ”₯ Overheating
- 🌫️ Dust Accumulation
- πŸ”§ Physical Breakage
""")

uploaded_image = st.file_uploader("Upload a thermal image of a solar panel", type=["jpg", "png", "jpeg", "webp"])

if uploaded_image:
    image = Image.open(uploaded_image).convert("RGB")
    st.image(image, caption="Uploaded Thermal Image", use_column_width=True)

    with st.spinner("Analyzing for thermal faults..."):
        results, annotated_image = detect_faults(image)

        if results:
            st.error("❗ Faults Detected:")
            for fault in results:
                st.write(f"- πŸ”΄ **Fault Type:** {fault[0]} | **Confidence:** {fault[1]:.2f}")
            st.image(annotated_image, caption="Detected Faults", use_column_width=True)
        else:
            st.success("βœ… No faults detected.")