This is our final project for the Computer Vision course at NCHU, Fall 2024. We use the YOLOv11s model to detect defects on printed circuit boards (PCBs). With an mAP50 of 0.995, the model achieves exceptional accuracy and demonstrates high inference speed.
| Dark | Light |
|---|---|
![]() |
![]() |
main.ipynb: Code for training the PCB defect detection model and evaluating it on the test set.
app.py: Code for the Streamlit app, which allows users to upload an pcb image and view the defect detection results.
pcb_defect/: Directory containing the trained model and log files.
download_dataset.sh: Bash script for downloading the dataset.
requirements.txt: List of Python packages required to run the code.
ppt/final project.pdf: Presentation slides for this project.
- OS: Linux Mint 22
- Python: 3.11.10
git clone --depth 1 https://github.com/devilhyt/pcb-defect-detection.git
cd pcb-defect-detectionbash download_dataset.shpython --versionpip install -r requirements.txtStep 5. Open and view the main.ipynb file.
- This notebook contains the code for training the PCB defect detection model and evaluating it on the test set.
- If you plan to train the model, you can choose to enable or disable Weights & Biases logging.
# Enable Weights & Biases logging wandb enabled # Disable Weights & Biases logging wandb disabled
- If you choose to enable Weights & Biases logging, you need to log in to your account.
wandb login
streamlit run app.py- The server is running on http://localhost:8501
- Streamlit will just increment the port number to 8502, 8503, etc. if 8501 is in-use.
- Special thanks to Albert C.M. Yang, our instructor, for his guidance, valuable feedback, and support throughout the development of this project.
- Libraries:
- Dataset:
- HsiangYi Tsai, devilhyt on Github (Author)
- Andy Chen, chenchenchenabc on Github (Author)


