Shard Detail

tensorflow_lite v0.9.2

tensorflow lite bindings for crystal lang

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development

  github: spider-gazelle/tensorflow_lite



A library for running TF Lite models

  • once you've trained a model in TensorFlow you can convert it to TF Lite for production use
  • inspect the TF Lite model using
  • some good TF models for object detection (need conversion)


  1. Add the dependency to your shard.yml:

        github: spider-gazelle/tensorflow_lite
  2. Run shards install


require "tensorflow_lite"

you can use the example metadata extractor to obtain the metadata for TF Lite models downloaded from


To update tensorflow lite bindings ./

lib installation

Requires libtensorflow to be installed, this is handled automatically by ./

  • there is a guide to building it
  • you can use ./ to automate this
  • then requires export LD_LIBRARY_PATH=/usr/local/lib to run
  • test if installed successfully crystal ./src/
    • this will output Launching with tensorflow lite vx.x.x

NOTE:: the lib is installed for local use via a postinstall script. Make sure to distribute with your production app


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request