Hereβs a clean, professional, GitHub-ready README tailored exactly to your project and code. You can copy-paste this into README.md.
An end-to-end Barcode and QR Code detection & decoding system built using YOLO, OpenCV, pyzbar, and Streamlit. The system first detects barcodes/QR codes using a trained YOLO model, then decodes them using enhanced image preprocessing techniques for higher accuracy.
- π Object Detection using a custom YOLO model
- π§ Robust Decoding with pyzbar and image enhancement (CLAHE + thresholding)
- πΌοΈ Supports multiple barcodes/QR codes in one image
- β‘ Efficient image resizing for faster inference
- π Interactive Web App powered by Streamlit
- π Detailed logging for debugging and monitoring
- Python
- YOLO (Ultralytics)
- OpenCV
- pyzbar
- NumPy
- Streamlit
- PIL
.
βββ app.py # Main Streamlit application
βββ best.pt # Trained YOLO model (required)
βββ README.md
βββ requirements.txt
- Clone the repository
git clone https://github.com/your-username/barcode-scanner.git
cd barcode-scanner- Install dependencies
pip install -r requirements.txt- Add YOLO model
- Place your trained YOLO model as
best.ptin the project root directory.
-
User uploads an image via the Streamlit UI
-
YOLO detects barcode / QR code regions
-
Each detected region is cropped
-
Image preprocessing is applied:
- Grayscale conversion
- CLAHE contrast enhancement
- Adaptive thresholding
-
pyzbar attempts decoding using multiple strategies
-
Decoded text is displayed to the user
- Supports multiple detections per image
- Displays decoded text clearly in the UI
- Gracefully handles unreadable or missing barcodes
Just tell me π