How sathwikgoundla/textile-inspection works
TextileVision AI is a real-time textile inspection dashboard. The documented workflow captures camera frames, classifies textile versus non-textile, detects and scores defects, records inspections, and streams results to the dashboard. The sampled WebSocket handler shows a scan-triggered analysis and database write, while the sampled main module also contains its own OpenCV analysis; the separate detector and preprocessing modules are documented capabilities, but their integration into that handler is not established by the excerpts. The graph preserves these branches and the stats/logs API; some links reflect README documentation rather than inspected call sites.
Main entry points: main.py Live scan handler · index.html Dashboard UI · camera.py Camera manager · preprocessing.py Frame preprocessing
Components 14
Image Capture
- Camera manager
backend/utils/camera.py - Frame preprocessing
backend/utils/preprocessing.py
Inspection Engine
- OpenCV frame analysis
backend/main.py - Textile classifier
backend/models/detector.py - Defect analysis
backend/models/defect_detector.py - Result visualization
backend/main.py
API and Persistence
- Live scan handler
backend/main.py - HTTP API routes
backend/main.py - Database sessions
backend/database/db.py - Inspection log model
backend/database/models.py - Inspection database
backend/textile_inspection.db
Dashboard
- Dashboard UI
frontend/index.html
Other components
- Operator
- Camera input
Connections 14
- Operator → Dashboard UI: views results
README.md - Camera input → Camera manager: provides frames
README.md - Camera manager → Frame preprocessing: supplies frames
- Frame preprocessing → Textile classifier: prepares frames
README.md - Textile classifier → Defect analysis: routes textiles
README.md - Operator → Live scan handler: requests scan
backend/main.py - Live scan handler → OpenCV frame analysis: analyzes frame
backend/main.py - OpenCV frame analysis → Result visualization: creates annotated view
backend/main.py - Live scan handler → Database sessions: uses session
backend/main.py - Live scan handler → Inspection log model: creates log
backend/main.py - Live scan handler → Dashboard UI: streams results
README.md - HTTP API routes → Inspection log model: queries history
backend/main.py - Database sessions → Inspection database: connects to
backend/database/db.py - HTTP API routes → Dashboard UI: serves interface
backend/main.py