Giter Site home page Giter Site logo

barcode-detection's Introduction

Barcode-detection

This project aims to develop a deep learning model able to detect a barcode in a given image. The model behind it is Tiny YOLO 3, which a light version of YOLO 3 with less hidden layers in the neural network architecture. This helps significantly reduce the inference time, although its predictive accuracy is lower than YOLO 3 itself. For real time applications, this trade-off can be accepted in most cases.

Description

Here are the 4 steps for this project :

  • Implement Tiny YOLO 3 with pretrained weights (80 classes). Using transfer learning, train a model on a set of ~600 barcodes images (90% train / 10% validation).
  • Use the model trained for inference on a new image.
  • Use pyzbar (python library to read barcodes) to decode the barcode.
  • Call OpenfoodFact API to retrieve informations about the product (for food products). The final model can be tested in a streamlit app, by uploading an image and getting the resulting image with a bounding box over the barcode.

Installation

  1. Install python 3.6+.

  2. Install zbar for Mac/Linux:

    Linux :

    sudo apt-get install libzbar0
    

    Mac (make sure brew is installed):

    brew install zbar
    

    The zbar DLLs are included with the Windows Python wheels.

  3. Clone this repository

    git clone <url>
    
  4. Install the requirements

    pip install -r requirements.txt
    

Inference

The inference result depends on some parameters tuning that can be made in settings.py file, especially for:

  • score_threshold
  • iou_threshold

These parameters can be changed before starting the app. The app can be started like follows :

  1. Launch streamlit app :
    streamlit run app.py
    
  2. Upload image and click "Launch barcode detection"
  3. If the barcode is detected, a bounding box will appear in the image around the barcode.
  4. If the barcode is decoded, it will show in the screen.
  5. If the OpenFoodFacts API contains information about the product, it will appear in the product info section.

Training

TBD

References

Keras implementation of Tiny Yolo v3 : https://github.com/zzh8829/yolov3-tf2

barcode-detection's People

Contributors

dchakour avatar

Stargazers

boolayon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.