How hvora2005/industrial-defect-detection works
The product is a local-network industrial defect inspection system: a phone browser captures or uploads images, the laptop backend decodes and evaluates them, and results return to the phone while also reaching a live monitor and persistent history. Dashboard statistics and CSV/PDF exports form a reporting branch; model preparation and training form an offline model lifecycle branch. The main request, detector, database, reports, and browser interactions are excerpted. Dashboard and training connections follow explicit README descriptions or shown client requests; other unsampled details are omitted.
Main entry points: main.py FastAPI Routes · database.py History & Stats · detector.py YOLO Detection · app.js Capture & Upload
Components 17
Phone Inspection
- Capture & Upload
frontend/app.js
Inspection Backend
- FastAPI Routes
backend/main.py - Image Decode
backend/main.py - YOLO Detection
backend/detector.py - Inference Config
backend/config.py
History & Reporting
- History & Stats
backend/database.py - Inspection History
backend/database.py - CSV/PDF Reports
backend/reports.py
Laptop Views
- Monitor Connections
backend/main.py - Live Monitor
frontend/monitor.js - Statistics Dashboard
frontend/dashboard.js
Model Lifecycle
- Dataset Conversion
training/convert_voc_to_yolo.py - YOLO Training
training/train.py - Trained Weights
model
Other components
- Phone Browser
- Local Wi-Fi
- Operator
Connections 20
- Operator → Phone Browser: uses
README.md - Phone Browser → Local Wi-Fi: sends images
README.md - Local Wi-Fi → FastAPI Routes: HTTPS requests
README.md - Capture & Upload → FastAPI Routes: posts /detect, /upload
frontend/app.js - FastAPI Routes → Image Decode: decodes upload
backend/main.py - FastAPI Routes → YOLO Detection: calls predict
backend/main.py - YOLO Detection → Inference Config: reads settings
backend/detector.py - YOLO Training → Trained Weights: copies best weights
training/train.py - YOLO Detection → Trained Weights: loads model
- FastAPI Routes → Capture & Upload: returns result
README.md - FastAPI Routes → History & Stats: saves inspection
backend/main.py - History & Stats → Inspection History: reads and writes
backend/database.py - FastAPI Routes → Monitor Connections: broadcasts results
backend/main.py - Live Monitor → FastAPI Routes: opens WebSocket
README.md - Monitor Connections → Live Monitor: pushes detections
backend/main.py - Statistics Dashboard → FastAPI Routes: requests stats, history, trend
frontend/dashboard.js - FastAPI Routes → History & Stats: queries history and stats
backend/main.py - FastAPI Routes → CSV/PDF Reports: builds exports
backend/main.py - CSV/PDF Reports → History & Stats: reads stored data
backend/reports.py - Dataset Conversion → YOLO Training: prepares dataset
README.md