coral-tflite-delegate
v0.0.1
Published
A tflite delegate for using Coral accelerators.
Downloads
8
Readme
Coral Delegate for tfjs-tflite-node
The coral-tflite-delegate
package adds support for Coral EdgeTPU Accelerators to tfjs-tflite-node.
Installing
This package depends on the EdgeTPU Runtime Library (libedgetpu). Follow the instructions here to install it on Linux (x64, arm64), Mac (x64), or Windows (x64). libedgetpu can also be built from source if binaries are not available for your platform.
After libedgetpu is installed, you can install the coral-tflite-delegate
package with npm i --save coral-tflite-delegate
.
Usage
Register the Coral delegate while loading a TFLite model in tfjs-tflite-node
by adding it to the list of delegates in the TFLite options:
const model = await loadTFLiteModel('./model_edgetpu.tflite', {
delegates: [new CoralDelegate()],
});
The Coral delegate will be used for any edgetpu ops the model contains. Most model files will need to be compiled for Coral before they can be accelerated. See the EdgeTPU documentation for more details on how to do this.