tflite-neutron-delegate is one external delegate for tensorflow lite, it is constructed with neutron-software, it can build tflite models and run on imx Neutron NPU.
git clone {this repo}
cd tflite-neutron-delegate
git submodule update --init --recursive# set the toolchain env
source /PATH_TO_TOOLCHAIN/environment-setup-cortexa53-crypto-poky-linux
# build the delegate
mkdir build && cd build
cmake ..
make -j 8
# benchmark_model
make benchmark_model -j8
# label_image
make lable_image -j8If you would like to build using local version of tensorflow, you can use FETCHCONTENT_SOURCE_DIR_TENSORFLOW cmake variable. Point this variable to your tensorflow tree. For additional details on this variable please see the official cmake documentation
cmake -DFETCHCONTENT_SOURCE_DIR_TENSORFLOW=/my/copy/of/tensorflow \
-DOTHER_CMAKE_DEFINES...\
..After cmake execution completes, build and run as usual.
If tensorflow source code downloaded by cmake, you can find it in <build_output_dir>/_deps/tensorflow-src
./benchmark_model --external_delegate_path=<patch_to_libneutron_delegate.so> --graph=<tflite_model.tflite>