Skip to main content
Impulses can be deployed as an optimized OpenMV library or firmware. This packages all your signal processing blocks, configuration and learning blocks up into a single package. You can include this package in your own application to run the impulse locally. In this tutorial, you’ll export an impulse and run the application on one of the OpenMV compatible boards.

Prerequisites

Make sure you followed either the Image classification or the FOMO: Object detection for constrained devices tutorials, have a trained impulse, and can have the latest OpenMV IDE v2.9.0 or above.

Compatible camera-boards

Deploying your impulse as an OpenMV library

This method only works on small image classification models, if you run into a memory issue, please head to Deploying your impulse as an OpenMV firmware section (preferred method). Head over to your Edge Impulse project, and go to Deployment. From here you can create the full library which contains the impulse and all external required libraries. Select OpenMV library and click Build to create the library. Then download and extract the .zip file. To add the model to your OpenMV camera copy the trained.tflite and labels.txt files to the ‘OpenMV Cam’ volume (like a USB drive).
OpenMV Cam storage volume with trained.tflite and labels.txt copied from the deployment package

Uploading the trained model to your OpenMV camera

Next, open the ei_image_classification.py file in the OpenMV IDE, and press the ‘Play’ icon to run the script.
OpenMV IDE running the image classification script with camera output and prediction results

Running your impulse on your OpenMV camera.

Deploying your impulse as an OpenMV firmware

This method is preferred. In this section, we will flash a new firmware to the board that contains only what is necessary to run your impulse. This firmware includes your custom edge impulse model. Head over to your Edge Impulse project, go to Deployment, click on OpenMV firmware and Build:
Edge Impulse Deployment page with OpenMV firmware selected for building a firmware package
Save the generated .zip file, extract it and you should see the following structure:
Firmware namingThe naming is likely to change soon to be more explicit. In the meantime, here is the firmware-board correspondence:
  • NICLAV - Arduino Nicla Vision
  • OPENMV3 - OpenMV Cam M7
  • OPENMV4 - OpenMV Cam H7
  • OPENMV4P - OpenMV Cam H7 Plus
  • OPENMVPT - OpenMV Pure Thermal
  • PORTENTA - Arduino Portenta
  • RT1060 - OpenMV Cam RT1062
Plug your device into your computer. Note: If you are using one of the Arduino boards, double press on the RESET button. Then, on your OpenMV IDE, go to Tools->Run Bootloader (Load Firmware).
OpenMV IDE Tools menu with Run Bootloader (Load Firmware) selected
Select Erase internal file system:
Bootloader dialog with Erase internal file system enabled before loading firmware
Click on Run and wait until the board’s blue LED blinks. You should see one of the following screen:
OpenMV IDE firmware update dialog reporting a successful flash operation
Click on OK and open (File->Open File) the ei_image_classification.py or ei_object_detection.py script provided in the downloaded .zip. To run the script, click on the “Play” button on the bottom-left corner of the OpenMV IDE.
OpenMV IDE with the Edge Impulse script ready to run from the play button
Voilà! You now have your impulse running on your OpenMV camera!

Troubleshooting

Only quantized (int8) models are supported

Deployment error indicating that only quantized int8 models are supported for OpenMV
OpenMV only supports quantized models. However, if you encounter this issue, here is a quick fix: Click on C++ library, select Quantized (int8) at the bottom of the Deployment page and select again the OpenMV firmware to build again. This issue will be fixed in the next release, OpenMV deployment jobs will be forced to use int8 models.

No DFU settings for the selected board type!

OpenMV IDE error dialog showing no DFU settings for the selected board type
Your board has not been put in bootloader mode. This happens on Arduino boards if you have not double press the RESET button before uploading the firmware.

RuntimeError: Sensor control failed.

OpenMV IDE runtime error indicating that sensor control failed
The Arduino Portenta only supports greyscale images, change:
to