How to Implement the Code of an Extracted Object Detection Model onto Project Code

Question/Issue: Hello, I am a beginner in machine learning and object detection. I’m utilizing FOMO for a thesis project and I would appreciate some help. How do I implement the code of an extracted object detection model onto my project code? And can I edit the code of this extracted model to do other things with other hardware components?

Context/Use case: In this case, I would be using C++ or Arduino. (Does Edge Impulse support MicroPython?)

Hi @Ceosine,

There is no MicroPython support right now (with the exception of the OpenMV library, but that does not generalize to other MCUs/boards).

I recommend reading through this guide (As a generic C++ library - Edge Impulse Documentation) to understand how to work with the C++ library. The Arduino library will be very similar. For object detection, the result struct will contain a result.bounding_boxes array with information about the bounding box predictions from FOMO (or other object detection models).

I recommend looking at this example (specifically the line highlighted) to see how to work with object detection inference results: example-standalone-inferencing/main.cpp at master · edgeimpulse/example-standalone-inferencing · GitHub.

1 Like

Thank you for the info, it’s much appreciated.

I’d like to add a question further, can I train the object detection model I created from Edge Impulse Studio in Google Colab?

Hi @Ceosine,

If you create a model in Edge Impulse, you can download it as a Keras SavedModel or .h5 file from your dashboard. You should be able to retrain the model using those file in another framework (e.g. Colab). However, please note that parts of the training algorithm (e.g. loss function) for FOMO is closed source, so it might be tough to train specifically FOMO.

1 Like

Are there any possible tutorials or links that I could follow?

Hi @Ceosine,

We do not have any tutorials the specifically show how to do this. However, you should be able to download the model (.h5 or SavedModel) from your dashboard. Then, you can use the load_model() function (see here). From there, you should be able to train the model (e.g. model.fit()).

1 Like