Spaces:
Sleeping
Sleeping
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,12 +1,46 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: PCB Image2Schematic
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.1
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# π PCB Image β Schematic
|
| 13 |
+
|
| 14 |
+
Convert a PCB photo into a KiCAD schematic automatically using AI.
|
| 15 |
+
|
| 16 |
+
## Pipeline
|
| 17 |
+
1. **Component Detection** β YOLOv8 via Roboflow API detects resistors, capacitors, ICs etc.
|
| 18 |
+
2. **IC Text Reading** β EasyOCR reads part numbers from chip silkscreen
|
| 19 |
+
3. **Netlist Generation** β OpenCV trace following + proximity detection finds connections
|
| 20 |
+
4. **KiCAD Output** β Generates `.kicad_sch` file ready to open in KiCAD
|
| 21 |
+
|
| 22 |
+
## Local Setup
|
| 23 |
+
```bash
|
| 24 |
+
git clone https://github.com/sanjay-r123/pcb-image2schematic
|
| 25 |
+
cd pcb-image2schematic
|
| 26 |
+
python -m venv venv
|
| 27 |
+
venv\Scripts\activate
|
| 28 |
+
pip install -r requirements.txt
|
| 29 |
+
python app.py
|
| 30 |
+
```
|
| 31 |
+
Then open http://localhost:7860
|
| 32 |
+
|
| 33 |
+
## Run Individual Stages
|
| 34 |
+
```bash
|
| 35 |
+
python detector.py "your_pcb.jpg"
|
| 36 |
+
python ocr.py "your_pcb.jpg" "your_pcb_results.json"
|
| 37 |
+
python netlist.py "your_pcb.jpg" "your_pcb_results_ocr.json"
|
| 38 |
+
python kicad_writer.py "your_pcb_netlist.json"
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Tech Stack
|
| 42 |
+
- Roboflow YOLOv8 β component detection
|
| 43 |
+
- EasyOCR β IC text reading
|
| 44 |
+
- OpenCV β trace detection
|
| 45 |
+
- KiCAD format β schematic output
|
| 46 |
+
- Gradio β web UI
|