OpenMV
Shields
Lens
Robotics
Book
Video
Download
Docs
Forum
OpenMV.io
GithubArtificial intelligence has two very common tasks in the field of vision: classification and object detection.
Category:Determine which category the image belongs to, for example, whether it is a cat or a dog.
Object Detection:Used to locate the positions, quantities, and dimensions of multiple distinct objects in an image.
In previous video tutorials, we explained how to use the OpenMV4 Plus to train neural networks online for classifying different objects. It can determine in real time whether an image within the OpenMV’s field of view contains a specific object—for example, whether a face is wearing a mask—but it cannot output the coordinates of faces or masks, nor the number of faces.
As object detection is significantly more complex and computationally intensive than classification, it is rarely implemented on microcontrollers. The main control MCU of OpenMV is the STM32H7. We have now added a new feature to SingTown that enables object detection–like tasks to run directly on microcontrollers, delivering outstanding performance.

Today, we will explain to youTraining demonstrates traffic sign detection in real-road environments, detecting traffic signs on our actual roadssuch as no-horn zones, no-parking zones, and speed limits of 80 km/h, rather than laboratory environments free from interference.
You can view the entire project content, including all code and models, at the following address: https://book.openmv.cc/project/traffic-sign.html
It is widely known that real-world environments—particularly road environments—are highly complex and subject to numerous interferences. We captured images of traffic signs in real-world environments using devices such as smartphones, and trained a model on Edge Impulse’s online platform—a partner of OpenMV—by manually labelling approximately 270 images; the training process took only ten minutes. The resulting model achieved an F1 score accuracy of 92%, and delivered a frame rate of 10 frames per second on OpenMV, ensuring both smooth operation and high accuracy.
Users may train the system to detect any target of interest—such as various numerals, different fruits, distinct markers, assorted components, or even any specific irregular object—by following our video tutorials, thereby enabling detection of the target’s quantity, coordinates, and object class name.
Note:This video tutorial covers the neural network keypoint detection feature, which is compatible not only with the OpenMV4 H7 Plus but also with the OpenMV4 H7. Since the trained FOMO keypoint detection model is compact—exhibiting excellent performance while occupying only several tens of kilobytes—the model can be slightly downsized for deployment on the OpenMV4 H7, despite its smaller RAM capacity compared to the Plus variant.
Below is a brief introduction to the principle:
The primary design decision behind FOMO object detection on OpenMV is based on the idea that many object detection tasks do not actually require the size of objects, but only their positions within an image. Once the positions of objects are known, subsequent operations can be performed—for example, OpenMV can control a vehicle to move toward the detected target, enable a drone to land at a designated location, or control a robotic arm to grasp a specific target object.
The FOMO model is a model specially designed by EdgeImpulse for microcontroller environments; unlike conventional object detection, it can only detect the positions and count of multiple objects, but cannot determine their exact dimensions.
The underlying principle of the FOMO model is extremely simple and flexible. It first divides an image into patches, each measuring 8×8 pixels. For an image with a resolution of 96×96, this results in a 12×12 grid of cells; for an image with a resolution of 360×360, it results in a 40×40 grid of cells. Image classification is then performed independently on each cell.
Compared with YOLO V5 or MobileNet SSD, FOMO performs significantly better on a large number of small objects. FOMO object point detection is 30 times faster than MobileNet SSD.
FOMO performs better when the objects to be detected are of similar sizes—for example, when the markers to be identified are approximately the same size, rather than varying significantly in size between very large and very small objects.
OpenMV uses EdgeImpulse to train neural network object detection models online, primarily involving the following steps: collecting and uploading image datasets, labelling objects, training, testing the model, and deployment.
* Image dataset collection: Capture images of specific objects in the actual environment where recognition will be performed. Images are collected in the same environment where recognition will occur, ensuring that the actual training environment closely matches the actual detection environment for optimal performance.
* Annotation Target: Draw bounding boxes around each target to be detected in our dataset and label them with the corresponding target names to facilitate subsequent training for target localization and identification.
* Training Model: After annotation is completed, train the model using the convolutional neural network parameters designed by us.
* Testing Model: We conduct testing using the trained model; if the results are unsatisfactory, we correspondingly expand the training dataset or adjust the training parameters and continue training until an acceptable model is achieved.
*Deployment: We can run the trained model file directly from the built-in USB drive of the OpenMV.
Below demonstrates the specific process:
01. Collect and upload the image dataset
I. First, log in to the website edgeimpulse.com, select “Log In”, enter the name of the new project, and select “Images” → “Classify multiple objects”

II. Select an image to upload. There are several ways to obtain the image dataset:
1. Capture images in real time using the OpenMV IDE. Use the “Dataset Editor” tool within the OpenMV IDE to create a new dataset and capture images in real time; for details, refer to our previous video tutorial on object classification and mask detection.

2. Images downloaded from the internet or captured using a mobile phone; preferably matching the actual environment you intend to test. We have prepared approximately four to five hundred images of traffic signs, including “No Parking”, “No Horn Blowing”, and “Speed Limit 80 km/h”, all collected from real road conditions. This dataset is available for download from our GitHub repository and tutorial website.
02. Labelling Objectives
Approximately 100 images are uploaded for each category; after the images are uploaded, image annotation must be performed to mark the positions and categories of the objects to be identified.


03. Train the Model
Configure the training parameters, change the resolution to 128×128, and select all default parameter settings; then click Save.

Generate features, with three colours representing three distinct markers.

Configure the target detection training parameters. The default number of training epochs is 60, the learning rate is 0.001, and the validation set ratio is 20%. Enable data augmentation. For transfer learning, select either the default MobileNetV2 0.35 or MobileNetV2 0.1. (Note: SSD cannot be used, as it is not supported on OpenMV.)
Select Start Training. Upon completion of training, the neural network model achieves an F1 Score of 91.2%, and we can save the current version.

Select a storage location, enter your description, and then click Save.

04. Deploying the Model
Export the trained model file. Only the library needs to be exported; select OpenMV and click Build to begin deploying and exporting the model.

It will automatically download the model we exported, which is the model trained on our 300 images; thus, the entire training process is complete.

05. Run the Model
Running models on OpenMV:
Connect the OpenMV Plus, save the three trained files to the built-in USB drive of the OpenMV, and open the ei_object_detection.py file in the OpenMV IDE. Click Run, and the execution results will be displayed in the serial terminal.


This feature is also compatible with the OpenMV4. As the OpenMV4 does not have external SDRAM and has less memory, we can reduce the model size to enable it to run on the OpenMV4.
There are two methods to reduce the model size:
I. Reduce the training resolution from 128×128 to 96×96.
II. Modify the transfer learning model used by changing MobileNetV2 0.35 to MobileNetV2 0.1.
Finally, place the trained new file into the OpenMV4 and run it.
The above is our target point detection tutorial. We look forward to your results!

AI Sentinel Based on OpenMV: Automatic Alert for Unattended Key Locations
Automatically detects whether the door of a key location remains open for an extended period and issues a timely alert.

Personnel crossing boundary triggers an alarm; OpenMV interprets the “sense of security boundary”
Detecting personnel or equipment crossing virtual perimeter lines.

“AI Urban Management Officer” is Here: An Automated Street Vending Detection System Built on OpenMV
Automatically identifies illegal street vending activities to support daily urban governance.

Improper placement of gas cylinders? Use OpenMV to automatically trigger hazard alerts
Automatically identifies non-compliant placement positions of gas cylinders to proactively detect potential gas safety hazards.

Did you perform live-line work without wearing insulating gloves? OpenMV will immediately issue an alert!
Automatically identifies whether workers are wearing insulating gloves to assist in safe operations.

Utilising the OpenMV smart camera to identify surface defects on aluminium plates in real time
Online identification of defects on aluminium plate surfaces, such as scratches and dents, to support quality control.