tflite_web 0.0.1
tflite_web: ^0.0.1 copied to clipboard
Run Tensorflow Lite models on Web with TFLite JS
TFLite Web #
Run TFLite models on Dart JS. It is packaged in a WebAssembly binary that runs in a browser
Getting Started #
-
Unpack tflite folder (link) to your web folder. Result structure:
-- Web
├── tflite
├── tf-backend-cpu.js
├── tf-core.js
├── tf-tflite.min.js
├── tflite_web_api_cc_simd.js
├── tflite_web_api_cc_simd.wasm -
Initialize dependencies:
TFLiteWeb.initialize()
-
Load a model:
By URLTFLiteWeb.loadModelFromUrl
By DataTFLiteWeb.loadModelFromMemory
-
Create Tensor:
createTensor(data, shape, dataType)
-
Run model:
loadedModel.predict(inputs)
Current Version: #
- TF JS: 4.2.0
- TFLite: 0.0.1-alpha.9