Barcode Reader Demo

Demo Background

Barcodes are crucial in inventory management, asset tracking, ticketing, and information sharing. 1-D and 2-D barcodes condense information into a visually coded form. Laser-based scanners work well for 1-D barcodes, but cameras are required for 2-D, like QR codes. Camera based systems are often called "barcode imagers". The most compute-intensive task of barcode imagers is to find the barcode, rather to decode them. Deep learning is an effective technique for finding these barcodes.

This demo runs a custom trained YOLOX-nano neural network on the AM62A and performs object detection on images to find the 1-D and 2-D barcodes. Regions with detected codes are cropped and converted to grayscale for decoding using an open source library, zbar The decoded text is displayed along with the bounding box resulting from object detection.

The github repo hosting source code and user guides contains everything needed to reproduce or even expand on the demo. There are instructions to run the demo as-is on the AM62A.

How to get started

Please find the following resources for reproducing the demo. This requires:

  1. Get an AM62A starter kit EVM and a USB-camera
  2. Download the Edge AI Linux SDK
  3. Load the Edge AI Linux SDK via an SD card using the quick start guide
  4. Log into the EVM through a network connection
  5. Clone the git repo for this demo onto the EVM (or copy all files to the SD card)
  6. Run the setup script: setup_barcode_demo.sh
  7. Run the demo is C++ or Python3 from the root directory of the above repository on device:
    1. Python:
      python3 apps_python/app_edgeai.py configs/barcode-reader.yaml
    2. C++:
      ./apps_cpp/bin/Release/app_edgeai configs/barcode-reader.yaml

These steps are validated on the 8.6 and 9.0.0 Edge AI Linux SDK. Newer SDK versions may require recompiling the model using edgeai-tidl-tools and pulling from the main edgeai-gst-apps repository for any dependencies that differ.

The setup script will download a pretrained and precompiled model needed for this demo. Additional resources are linked for diving deeper into how the application works and how Edge AI tools were used to enable this application.

Additional Resources for the Barcode Reader Demo

Purpose Link
Retail Source Code with detailed Readme https://github.com/TexasInstruments/edgeai-gst-apps-barcode-reader/
Application Brief on barcode readers for TI processors https://www.ti.com/lit/pdf/sprad35

General Edge AI and AM62A resources

Purpose Link
Edge AI Studio; Model Analyzer and Model Composer https://dev.ti.com/edgeaistudio/
Top level github page for Edge AI https://github.com/TexasInstruments/edgeai
AM62A Datasheet (superset device) https://www.ti.com/product/AM62A7
AM62A Academy (Basic Linux Training/bringup) https://dev.ti.com/tirex/explore/node?node=A__AB.GCF6kV.FoXARl2aj.wg__AM62A-ACADEMY__WeZ9SsL__LATEST
Support Forums (See Processors -> AM62A7) https://e2e.ti.com