This repository contains a complete solution for detecting defects on printed circuit boards (PCBs). The system consists of a frontend built with React, Vite, and Tailwind CSS, and a backend powered by Flask and Python. A YOLOv8-based custom model, trained on a PCB defects dataset, is integrated into the backend for defect detection.
- Features
- Technologies Used
- Setup Instructions
- Frontend Overview
- Backend Overview
- Model Details
- Usage
- Contributing
- License
-
Frontend
- User-friendly interface for uploading PCB images.
- Real-time defect detection results.
- Built with React, Vite, and styled with Tailwind CSS.
-
Backend
- Handles image uploads and communicates with the YOLOv8 model.
- Built using Flask for seamless integration.
- Efficient and scalable architecture.
-
Model Integration
- YOLOv8 custom model trained on a Kaggle PCB defects dataset.
- High accuracy in detecting various PCB defects.
- React
- Vite
- Tailwind CSS
- Flask
- Python
- YOLOv8
- Kaggle dataset for PCB defects
- Node.js and npm (for the frontend)
- Python 3.x and pip (for the backend)
git clone https://github.com/yourusername/pcb-defect-detection.git
cd pcb-defect-detection- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Start the development server:
npm run dev
- Navigate to the backend directory:
cd backend - Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install required Python packages:
pip install -r requirements.txt
- Start the Flask server:
flask run
- Ensure the YOLOv8 custom model weights are saved in the
backend/modelsdirectory. - The model will automatically load when the backend is started.
The frontend provides a simple interface for users to upload images of PCBs and view the defect detection results. It is built with React, optimized using Vite, and styled using Tailwind CSS.
The backend is built with Flask and handles image processing and communication with the YOLOv8 model. It serves the defect detection results back to the frontend.
- Dataset: The model was trained using a PCB defects dataset sourced from Kaggle.
- Architecture: YOLOv8, known for its speed and accuracy in object detection tasks.
- Training: Custom training was performed to fine-tune the model for detecting specific PCB defects.
- Start both the frontend and backend servers.
- Open the frontend in your browser (typically at
http://localhost:5173). - Upload an image of a PCB through the interface.
- View the detection results, including defect types and locations.
Contributions are welcome! Please follow these steps:
- Fork this repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Description of changes" - Push to your branch:
git push origin feature-name
- Submit a pull request.
Feel free to reach out with any questions or suggestions. Happy coding!