IAR Embedded Workbench
This section provides step-by step instructions to setup Imagimob Commandline Tool inside IAR Embedded Workbench. The IAR Embedded Workbench automatically compiles TensorFlow .h5 files into .c and .h files. The Imagimob Commandline Tool is compatible with Tensorflow/Keras .h5 models generated with a Tensorflow backend of version 2.x. To know the supported layers and activation functions in Studio refer to Supported layers and functions (opens in a new tab).
The models that contain unsupported layers will fail to convert.
Pre-requisite
Make sure you have installed IMAGIMOB Studio.
Sample project
Here is a pre-configured sample project that can be loaded in IAR Embedded Workbench. Click to download sample project (opens in a new tab)
Setup Imagimob Commandline Tool for IAR Embedded Workbench Sample Project
To setup the Imagimob Commandline Tool for new or existing projects, follow the steps:
-
Go to Project → Options → Custom Build.
-
In Filename extensions, enter .h5.
-
In Command line, enter imc $FILE_PATH$ -oc $FILE_BNAME$.c -oh $FILE_BNAME$.h
-
In Output files, enter $FILE_BNAME$.c $FILE_BNAME$.h
-
Add the .h5 file that you want to convert to the project.
-
Make project (make sure that the project contains a file named main.c)
You can now find the generated .c and .h files under Files → Model.h5 → Output.