You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo has more than 120 models converted to run on Android with LiteRT, Google's on-device ML runtime. LiteRT is the new name of TensorFlow Lite. Most models come with input and output shapes, preprocessing, the conversion script and a standalone Kotlin sample app.
Most of the .tflite models run every op on the phone's GPU through CompiledModel. For example, DINOv2 ViT-S/14 at 448² runs in 53.6 ms on a Galaxy S26 GPU. The chat models run on LiteRT-LM, on a phone or a Mac.
If you like this repository, please give it a star.
Run a model
Download a .tflite from MODELS.md, put it in app/src/main/assets/, and add the dependency from Google Maven:
val options =CompiledModel.Options(Accelerator.GPU)
val model =CompiledModel.create(context.assets, "model.tflite", options, null)
val inputs = model.createInputBuffers()
inputs[0].writeFloat(floatArray)
val outputs = model.run(inputs)
val result = outputs[0].readFloat()
Each model's section in MODELS.md says how to prepare floatArray. Reading the output waits for the GPU, so time the run and the read together. Models over about 150 MB load from a file path instead of the APK. From LiteRT 2.3.0, the GPU also needs com.google.ai.edge.litert:litert-gpu at the same version as litert.
dpm, a tool for dancers to map the patterns they know, adapts the EdgeTAM video tracker in edgetam-video/ to anonymize video.
ImageSplitter, an Android app that splits a photo into numbered parts for large prints, upscales with real_esrgan_x4v3.tflite from this repo's v1 release.
License
MIT for the sample apps. kev/, julia1/, d1-3b/, clef-flash/ and wevisone/ carry their own Apache-2.0 LICENSE, and d1omni/ the LFM Open License v1.0, as it ports the model provider's code. Model licenses follow their original projects.
About
Converted TFLite Model Zoo for Android with LiteRT CompiledModel GPU acceleration