Skip to content

A YOLOv8-based system for detecting, cropping, and decoding barcodes from images. Trained on a custom barcode dataset, evaluated with precision, recall, and mAP metrics, and implemented using Ultralytics YOLO and Pyzbar libraries.

Notifications You must be signed in to change notification settings

Daudmax/barcode-decoder

Repository files navigation

📦 Barcode Decoder: A YOLOv8-Based System for Barcode Detection

Barcode Decoder Python License

Welcome to the Barcode Decoder repository! This project offers a robust system designed to detect, crop, and decode barcodes from images. Utilizing the power of YOLOv8, this system is trained on a custom barcode dataset and evaluated using precision, recall, and mAP metrics. The implementation leverages the Ultralytics YOLO and Pyzbar libraries, making it a reliable tool for barcode processing.

Table of Contents

Features

  • High Accuracy: Trained on a custom dataset, this system provides high accuracy in barcode detection.
  • Real-Time Processing: Fast detection and decoding of barcodes from images.
  • Flexible: Works with various image formats and sizes.
  • Comprehensive Evaluation: Uses precision, recall, and mAP metrics to assess performance.
  • Easy Integration: Simple to integrate into existing projects or workflows.

Installation

To set up the Barcode Decoder, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/Daudmax/barcode-decoder.git
    cd barcode-decoder
  2. Install Required Libraries:

    Ensure you have Python 3.8 or higher installed. Then, install the necessary libraries using pip:

    pip install -r requirements.txt
  3. Download the Model:

    Visit the Releases section to download the model file. Follow the instructions to execute the downloaded file.

Usage

Once you have installed the Barcode Decoder, you can use it as follows:

  1. Run the Detection Script:

    Use the command below to run the barcode detection on an image:

    python detect.py --image path/to/your/image.jpg
  2. View the Results:

    The script will output the detected barcodes along with their coordinates and decoded values.

  3. Real-Time Detection:

    For real-time detection using your webcam, run:

    python detect.py --video

Dataset

The system is trained on a custom barcode dataset, which includes various types of barcodes in different environments. This diversity ensures that the model generalizes well across different scenarios.

  • Dataset Size: The dataset contains over 10,000 images.
  • Types of Barcodes: Includes QR codes, UPC codes, EAN codes, and more.

Evaluation Metrics

To ensure the effectiveness of the model, we evaluate it using the following metrics:

  • Precision: Measures the accuracy of the detected barcodes.
  • Recall: Indicates how many actual barcodes were detected.
  • mAP (Mean Average Precision): A comprehensive metric that combines precision and recall.

These metrics provide insights into the model's performance and help in making necessary adjustments.

Contributing

We welcome contributions from the community. If you would like to contribute to the Barcode Decoder project, please follow these steps:

  1. Fork the Repository: Click the "Fork" button on the top right corner of this page.

  2. Create a Branch: Create a new branch for your feature or bug fix.

    git checkout -b feature/YourFeatureName
  3. Make Changes: Implement your changes and commit them.

    git commit -m "Add Your Feature"
  4. Push to Your Fork:

    git push origin feature/YourFeatureName
  5. Create a Pull Request: Submit a pull request detailing your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

For the latest updates and downloadable files, visit the Releases section. Download the necessary files and execute them as needed.

Conclusion

The Barcode Decoder is a powerful tool for anyone looking to integrate barcode detection and decoding into their applications. With its high accuracy and ease of use, it stands out as a reliable solution in the field of computer vision and deep learning.

Explore the project, contribute, and help us improve barcode detection for everyone!

About

A YOLOv8-based system for detecting, cropping, and decoding barcodes from images. Trained on a custom barcode dataset, evaluated with precision, recall, and mAP metrics, and implemented using Ultralytics YOLO and Pyzbar libraries.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •