Beam Bots Logo

bb_inference_tflite

CI License: Apache 2.0 Hex version badge Hexdocs badge REUSE status Ask DeepWiki

A bb_inference runtime that runs TensorFlow Lite models through tflite_elixir.

inference do
  model :detector do
    runtime BB.Inference.TFLite
    source "https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip"
    archive_member "detect.tflite"
    sha256 "e4b118e5e4531945de2e659742c7c590f7536f8d0ed26d135abcfe83b4779d13"
    codec {BB.Estimator.ObjectDetection.FinalDetections, mean: 127.5, std: 127.5}
  end
end

Quantised models

Raw values pass straight through. describe/1 reports each tensor's raw type and its scale and zero point - per tensor, or per axis with the axis - and run/2 takes and returns tensors of exactly those types, refusing an input of the wrong type rather than reinterpreting its bytes. The model's codec quantises and dequantises.

Layout is always nil: TFLite tensors carry none.

Options

Installation

def deps do
  [
    {:bb_inference_tflite, "~> 0.1.0"}
  ]
end