Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Qualcomm® AI Hub Apps

Object Detection Sample App

This sample app performs object detection on live camera input.

The app aims to showcase an example of combining streaming camera, TFLite, and OpenCV.

Prerequisites

  1. Clone this repository with Git-LFS enabled.
  2. Download Android Studio. Version 2023.1.1 or newer is required.
  3. Enable USB debugging on your Android device.

Build the APK

  1. Download or export a compatible model from AI Hub Models.
  2. Copy the .tflite file to src/main/assets/detector.tflite
  3. Copy the labels file (see list below) to src/main/assets/labels.txt
  4. Open this folder in Android Studio, run gradle sync, and build the OBjectDetection target.

Supported Hardware (TF Lite Delegates)

By default, this app supports the following hardware:

Comments have been left in TFLiteHelpers.java and AIHubDefaults.java to guide you on how to add support for additional TF Lite delegates that could target other hardware.

AI Model Requirements

Model Runtime Formats

  • TensorFlow Lite (.tflite)

I/O Specification

INPUT Description Shape Data Type
image An RGB image [1, Height, Width, 3] float32 input expecting inputs normalized to [0, 1]
OUTPUT Description Shape Data Type
boxes Bounding Boxes [1, Anchors, 4] float32 boxes (x0, y0, x1, y1) in pixel space
scores Class Scores [1, Anchors] float32 class logit predictions
class_idx Class Index [1, Anchors] uint8 or int32 class index

The app is developed to work best with a Width/Height ratio of 1.

Compatible AI Hub Models

The app is currently compatible with the TFLite float variant of these models:

Replicating an AI Hub Profile / Inference Job

Each AI Hub profile or inference job, once completed, will contain a Runtime Configuration section.

Modify TFLiteHelpers.java according to the runtime configuration applied to the job. Comment stubs are included to help guide you (search for TO REPLICATE AN AI HUB JOB...)

Note that if your job uses delegates other than QNN NPU, GPUv2, and TFLite, then you'll also need to add support for those delegates to the app.

Technologies Used by this App

License

This app is released under the BSD-3 License found at the root of this repository.

All models from AI Hub Models are released under separate license(s). Refer to the AI Hub Models repository for details on each model.

The QNN SDK dependency is also released under a separate license. Please refer to the LICENSE file downloaded with the SDK for details.