# josecerejo/solar-panel-defect-detector architecture

> Architecture diagram of the GitHub repository josecerejo/solar-panel-defect-detector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josecerejo/solar-panel-defect-detector
- Repository: https://github.com/josecerejo/solar-panel-defect-detector

## Overview

This repository is a small YOLOv8 solar-panel defect detection demo. A user submits an image and confidence threshold through Gradio; the app runs inference with the bundled weights, annotates detections, and returns an image and count. Dataset auditing, training, and evaluation are described in the README, but their implementation is not present in the supplied tree, so they are not modeled as runtime components.

Main entry points: [`app.py`](https://github.com/josecerejo/solar-panel-defect-detector/blob/main/app.py) (Demo app), [`best.pt`](https://github.com/josecerejo/solar-panel-defect-detector/blob/main/best.pt) (Model weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_gradio["Gradio UI"]
node_app["Demo app<br/>[app.py]"]
node_yolo["YOLO inference"]
node_weights["Model weights<br/>[best.pt]"]
node_annotated["Annotated image"]
node_summary["Detection count"]

node_user -->|"submits image"| node_gradio
node_gradio -->|"calls predict"| node_app
node_app -->|"runs inference"| node_yolo
node_app -->|"loads weights"| node_weights
node_yolo -->|"returns results"| node_app
node_app -->|"plots detections"| node_annotated
node_app -->|"counts boxes"| node_summary
node_annotated -->|"displays image"| node_gradio
node_summary -->|"displays count"| node_gradio
node_gradio -->|"shows outputs"| node_user

click node_app "https://github.com/josecerejo/solar-panel-defect-detector/blob/main/app.py"
click node_weights "https://github.com/josecerejo/solar-panel-defect-detector/blob/main/best.pt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_gradio toneBlue
class node_app toneTeal
class node_yolo,node_weights,node_annotated,node_summary toneIndigo
```

## Components

### Other components

- **User**
- **Gradio UI**
- [Demo app](https://github.com/josecerejo/solar-panel-defect-detector/blob/main/app.py): `app.py`
- **YOLO inference**
- [Model weights](https://github.com/josecerejo/solar-panel-defect-detector/blob/main/best.pt): `best.pt`
- **Annotated image**
- **Detection count**

## Connections

- User → Gradio UI: submits image
- Gradio UI → Demo app: calls predict
- Demo app → YOLO inference: runs inference
- Demo app → Model weights: loads weights
- YOLO inference → Demo app: returns results
- Demo app → Annotated image: plots detections
- Demo app → Detection count: counts boxes
- Annotated image → Gradio UI: displays image
- Detection count → Gradio UI: displays count
- Gradio UI → User: shows outputs
