How to use TensorFlow Lite on VOXL

We have developed an OpenCL GPU-accelerated TensorFlow Lite for ARM Linux and made it available for VOXL.

A video demonstration of TensorFlow Lite running in real-time on the VOXL platform follows the Table of Contents

Table of contents

  1. How to use TensorFlow Lite on VOXL
    1. hellotflite Example
      1. Running on VOXL
    2. voxl-mpa-tflite-server Example
      1. Setup
      2. Running on VOXL

hellotflite Example

Running on VOXL

  • (PC) adb shell to get into voxl
  • (VOXL) Run: hello-voxl-tflite-gpu -c "HIRES-CAMERA_ID" -W 1024 -H 768 (e.g. hello-voxl-tflite-gpu -c 0 -W 1024 -H 768)
    • For help with command line, run: hello-voxl-tflite-gpu -h
  • (PC) open a new terminal window, and adb shell to get into voxl
  • (VOXL) run voxl-perfmon to view GPU usage
  • (PC) open a third terminal window, and navigate back to the apps-proc-examples/hellotflitegpu/ directory
  • (PC) Run: sudo apt-get install python-qt4 to install dependencies
  • (PC) Run: python image_viewer_rgb.py --i IP-ADDRESS-OF-VOXL
    • get ip address by running ifconfig in a voxl shell

Please see example code details here

voxl-mpa-tflite-server Example

The Modal Pipe Architecture allows for modular access and sharing of low-level data around the VOXL platform. The voxl-mpa-tflite-server takes advantage of this architecture to enable a broad set of camera inputs and streaming outputs.

In this example image data from voxl-camera-server is processed by voxl-mpa-tflite-server and then streamed via RTSP using voxl-streamer

Setup

  • adb shell
  • bash
  • vi /etc/modalai/voxl-streamer.conf
    • change the “mpa-camera” field under “hires-mpa” from “hires/preview” to “tflite/image/”

Running on VOXL

  • (VOXL-1) adb shell
  • (VOXL-1) bash
  • (VOXL-1) voxl-camera-server -c /etc/modalai/voxl-camera-server.conf
  • (VOXL-2) adb shell
  • (VOXL-2) bash
  • (VOXL-2) voxl-mpa-tflite-server -m mobilenet
  • (VOXL-3) adb shell
  • (VOXL-3) bash
  • (VOXL-3) voxl-streamer
    To view the output rtsp stream, open VLC media player. Select media, open network stream, and the URL will be rtsp://YOUR-VOXL-IP-ADDRESS:8900/live