How manojgowda2000/pcb_defects_detection_using_yolo_model works
Project Type and Purpose
• Type: Machine-learning pipeline + lightweight inference UI
• Purpose: Automate PCB defect detection using YOLOv8 (object-detection) with transfer learning, and expose inference via a small web app.
File Structure
• Top-level scripts:
– train.py: orchestrates dataset loading, model fine-tuning, checkpoint saving
– app.py / streamlit.py: inference server or Streamlit UI for real-time detection
– main.ipynb: exploratory data analysis and prototyping
• Support files:
– requirements.txt: lists Python dependencies (ultralytics, torch, streamlit, etc.)
– test_images/: sample images folder for inference/testing
• Missing but implied:
– A data/ or custom dataset directory (described in README)
README for Additional Insights
• Workflow stages: Prepare data → Train (train.py) → Evaluate (viz.py) → Inference (app.py/streamlit.py)
• Key libraries: YOLOv8, PyTorch, Streamlit, Kaggle-sourced/custom annotated images
• Outputs: model checkpoints, inference results, real-time UI
Main Components
a. Data Ingestion
– Raw images (Kaggle + custom) in data/
– test_images/ for quick inference
b. Training Pipeline
– train.py calls YOLOv8 API (Ultralytics)
– Transfer learning: load pre-trained weights → fine-tune on PCB dataset
– Outputs: model artifacts (weights, logs)
c. Model Evaluation / Visualization
– viz.py or main.ipynb for metrics plots, confusion matrices, sample detections
d. Inference Service / Web UI
– app.py or streamlit.py
– Loads trained model → processes incoming image → returns annotated output
e. External Services / Libraries
– Ultralytics YOLOv8 (API calls)
– PyTorch (compute backend)
– Streamlit (web UI)
Architectural Patterns and Design Principles
• Separation of concerns: Training vs. Inference
• Modularity: visualization and UI layer abstracted from core ML code
• Reproducibility: requirements.txt + git versioning
• Pipeline orientation: clearly delineated stages for data, compute, and serving