# Imagimob Commandline Tool for IAR Embedded Workbench Sample Project
Before doing the steps in this guide make sure that you have installed Imagimob Studio.
This guide will show you how to setup Imagimob Commandline Tool inside IAR Embedded Workbench which can automaticly compile TensorFlow .h5 files into .c and .h files. This is done by first installing the Imagimob Commandline Tool and then use the Custom Build options inside IAR Embedded Workbench. Read more about compatibility here.
# Example Project
Here is a pre-configured example project that can be loaded in IAR Embedded Workbench.
Click to download example project (opens new window)
# Setup Imagimob Commandline Tool for IAR Embedded Workbench Project
To setup the Imagimob Commandline Tool for new or existing projects follow this guide.
- Go to Project → Options → Custom Build
- Add this under Filename extensions: .h5
- Add this line under Command Line: imc $FILE_PATH$ -oc $FILE_BNAME$.c -oh $FILE_BNAME$.h
- Add these lines under Output Files: $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)
- The generated .c and .h files can now be found in the Files window under model.h5 → Output.
The Imagimob Commandline Tool is compatible with Tensorflow/Keras .h5 models generated with a Tensorflow backend of version 2.x. Models containing unsupported layers will fail to convert. See supported layers and activation functions below.
# Supported TensorFlow layers
- Max pooling 1D (TensorFlow Class MaxPooling1D)
- Convolution 1D (TensorFlow Class Conv1D)
- Long Short-Term Memory (TensorFlow Class LSTM)
- Dense (TensorFlow Class Dense)
- Batch Normalization (TensorFlow Class BatchNormalization)
- Time Distributed (TensorFlow Class TimeDistributed)
- Global average pooling 1D (TensorFlow Class GlobalAveragePooling1D)
- Gated Recurrent Unit (TensorFlow Class GRU)
- Flatten (TensorFlow Class Flatten)
- Dropout (TensorFlow Class Dropout)
- Reshape (TensorFlow Class Reshape)
- Activation (TensorFlow Class Activation)
# Supported TensorFlow activation functions
- LeakyReLU (TensorFlow Class LeakyReLU)
- ReLU (TensorFlow Class ReLU)
- Hard Sigmoid
# Supported Imagimob layers and functions
- Assert Array
- Discrete Cosine Transform
- Dot product transpose
- Hann smoothing
- Frobenius norm
- Real Discrete Fourier Transform
- Average Subtract
- Power to Decibel
- Add an extra dimension of size 1
- Complex Discrete Fourier Transform
- FFT Shift
- Subtraction Immediate Reverse (A-x)
- Mel Filterbank
- Sliding Window
If you have problems converting a Tensorflow/Keras .h5 model generated with a TensorFlow 2.x backend, or have requests for improvements or additional support, please contact us at firstname.lastname@example.org.