It is a modified version of the TensorFlow Lite for Microcontrollers for use with HIMAX WE-I Plus Boards. Each example in the package has been tested in Ubuntu 20.04 LTS environment.
Following examples are included :
- magic wand example
- micro speech example
- person detection INT8 example
- handwriting example
- Prerequisites
- Deploy to Himax WE1 EVB
- Training your own model
- Convert model from PyTorch to TensorFlow Lite for Microcontrollers
-
Make Tool version
A
make
tool is required for deploying Tensorflow Lite Micro applications, See Check make tool version section for proper environment. -
Development Toolkit
Install one of the toolkits listed below:
-
MetaWare Development Toolkit
See Install the Synopsys DesignWare ARC MetaWare Development Toolkit section for instructions on toolchain installation.
-
GNU Development Toolkit
See ARC GNU Tool Chain section for more detail, current released GNU version is GNU Toolchain for ARC Processors, 2020.09. After download and extract toolkit to local space, please remember to add it to environment PATH. For example:
export PATH=[location of your ARC_GNU_ROOT]/bin:$PATH
-
-
curl command
Installing curl for Ubuntu Linux.
sudo apt update sudo apt upgrade sudo apt install curl
-
make command
Installing make for Ubuntu Linux. (If make is not installed)
sudo apt install make
-
Serial Terminal Emulation Application
There are 2 main purposes for HIMAX WE1 EVB Debug UART port, print application output and burn application to flash by using xmodem send application binary.
The example project for HIMAX WE1 EVB platform can be generated with following command:
Download related third party data and model setting (only need to download once)
make download
Default building toolchain in makefile is Metaware Development toolkit, if you are trying to build example with GNU toolkit. please change the ARC_TOOLCHAIN
define in Makefile
like this
#ARC_TOOLCHAIN ?= mwdt
ARC_TOOLCHAIN ?= gnu
Build magic wand example and flash image, flash image name will be magic_wand.img
make magic_wand
make flash example=magic_wand
Build micro speech example and flash image, flash image name will be micro_speech.img
make micro_speech
make flash example=micro_speech
Build person detection INT8 example and flash image, flash image name will be person_detection_int8.img
make person_detection_int8
make flash example=person_detection_int8
Build handwriting example and flash image, flash image name will be handwriting.img
. please check here to know more about handwriting detail.
make handwriting
make flash example=handwriting
After flash image generated, please download the flash image file to HIMAX WE1 EVB by UART, details are described here
Model used by handwriting example is training with MNIST dataset, please take a look here about training flow if you are interested in.
Whenever there is a PyTorch model in your hand, here is a tutorial to switch it to tflite model and deploy it on HIMAX WE1 EVB.