View Source TFLiteBEAM

TensorFlow Lite BEAM bindings with optional EdgeTPU support.

Coverage Status

OSArchABIBuild StatusHas Precompiled Library
Ubuntu 20.04x86_64gnuCIYes
Ubuntu 20.04arm64gnuCIYes
Ubuntu 20.04armv7lgnueabihfCIYes
Ubuntu 20.04armv6gnueabihfCIYes
Ubuntu 20.04riscv64gnuCIYes
macOS 11 Big Surx86_64darwinCIYes
macOS 11 Big Surarm64darwinCIYes

coral-support

Coral Support

dependencies

Dependencies

For macOS

# only required if not using precompiled binaries
# for compiling libusb
brew install autoconf automake

For some Linux OSes you need to manually execute the following command to update udev rules, otherwise, libedgetpu will fail to initialize Coral devices.

bash "3rd_party/cache/${TFLITE_BEAM_CORAL_LIBEDGETPU_RUNTIME}/edgetpu_runtime/install.sh"

compile-time-environment-variable

Compile-Time Environment Variable

  • TFLITE_BEAM_PREFER_PRECOMPILED

    Use precompiled binaries when TFLITE_BEAM_PREFER_PRECOMPILED is true. Otherwise, this library will compile from source.

    Defaults to true.

  • TFLITE_BEAM_CORAL_SUPPORT

    Enable Coral Support.

    Defaults to true.

  • TFLITE_BEAM_CORAL_USB_THROTTLE

    Throttling USB Coral Devices. Please see the official warning here, google-coral/libedgetpu.

    Defaults to true.

    Note that only when TFLITE_BEAM_CORAL_USB_THROTTLE is set to NO, :tflite_beam will use the non-throttled libedgetpu libraries.

  • TFLITE_BEAM_CORAL_LIBEDGETPU_LIBRARIES

    Choose which ones of the libedgetpu libraries to copy to the priv directory of the :tflite_beam app.

    Default value is native - only native libraries will be downloaded and copied. native corresponds to the host OS and CPU architecture when compiling this library.

    When set to a specific value, e.g, darwin_arm64 or darwin_x86_64, then the corresponding one will be downloaded and copied. This option is expected to be used for cross-compiling, like with nerves.

    Available values for this option are:

    ValueOS/CPU
    aarch64Linux arm64
    armv7lLinux armv7
    armv6Linux armv6
    k8Linux x86_64
    x86_64Linux x86_64
    riscv64Linux riscv64
    darwin_arm64macOS Apple Silicon
    darwin_x86_64macOS x86_64

installation

Installation

If available in Hex, the package can be installed by adding tflite_beam to your list of dependencies in rebar.config:

{deps, [
  {tflite_beam, "0.3.2"}
]}

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/tflite_beam.