Skip to content

DrugKit/Barcode-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Here’s a clean, professional, GitHub-ready README tailored exactly to your project and code. You can copy-paste this into README.md.


πŸ“¦ YOLO-Based Barcode & QR Code Scanner

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.


πŸš€ Features

  • πŸ” 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

πŸ› οΈ Tech Stack

  • Python
  • YOLO (Ultralytics)
  • OpenCV
  • pyzbar
  • NumPy
  • Streamlit
  • PIL

πŸ“‚ Project Structure

.
β”œβ”€β”€ app.py              # Main Streamlit application
β”œβ”€β”€ best.pt             # Trained YOLO model (required)
β”œβ”€β”€ README.md
└── requirements.txt

βš™οΈ Installation

  1. Clone the repository
git clone https://github.com/your-username/barcode-scanner.git
cd barcode-scanner
  1. Install dependencies
pip install -r requirements.txt
  1. Add YOLO model
  • Place your trained YOLO model as best.pt in the project root directory.

πŸ§ͺ How It Works

  1. User uploads an image via the Streamlit UI

  2. YOLO detects barcode / QR code regions

  3. Each detected region is cropped

  4. Image preprocessing is applied:

    • Grayscale conversion
    • CLAHE contrast enhancement
    • Adaptive thresholding
  5. pyzbar attempts decoding using multiple strategies

  6. Decoded text is displayed to the user


πŸ“Š Output

  • Supports multiple detections per image
  • Displays decoded text clearly in the UI
  • Gracefully handles unreadable or missing barcodes

Just tell me πŸ‘Œ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •