13.6. Edge Impulse¶
Edge Impulse is an end-to-end platform for building machine-learning models that run on microcontrollers: collect and label data, design and train a model in the browser, and have it optimized to fit a device measured in kilobytes. It deploys straight to OpenMV – a few clicks turn a trained model into files ready to run on the camera. Edge Impulse’s own documentation goes deeper on every step.
13.6.1. Getting data in¶
A model performs best on the kind of images it was trained on, so capture the dataset with the camera that will run it. The IDE’s dataset editor is built for exactly this – create class folders, capture labelled images from the live frame buffer, and then upload the dataset straight into an Edge Impulse project from the Export submenu (log in to your account there first). From that point on you work in Edge Impulse Studio.
See also
Edge Impulse’s own OpenMV Cam setup guide for installing the tools and connecting the camera.
13.6.2. Training¶
Training happens entirely in the browser: design an impulse (the input, processing, and learning blocks), train it, and check the accuracy on the held-out test data.
Two model types suit the camera. An image classifier outputs a list
of class scores, which you read straight off the model’s output –
no post-processor needed. FOMO, a fast object detector designed for
microcontrollers, needs one decoding step, and the camera ships a
post-processor for it (ml.postprocessing.edgeimpulse), so
those models run with no extra code either.
13.6.3. Deploying to the camera¶
When training finishes, open the project’s Deployment page,
pick the OpenMV Library target, and click Build. The download
is a zip holding the trained model (trained.tflite), its labels
(labels.txt), and an example script. The model is
integer-quantized. Edge Impulse covers this and the
custom-firmware alternative in its run on OpenMV guide.
Add the .tflite file to the camera with the IDE’s ROMFS
editor, which converts it for the board’s NPU when it
has one, and load it in a script with ml.Model. Models also run
from the camera’s flash drive – copy the files over and point
ml.Model at the path – but ROMFS is the better home: models
there execute straight from flash without a RAM copy.
See also
The machine learning chapter for running
models with the ml module – loading, the inference
pipeline, and decoding the output.