How to perform continuous image classification and generate some actionable output for Sony Spresense?

Question/Issue: I am trying to develop an image classification model on edge impulse using the Sony-Spresense board. It is working well but I wish to perform some actions based on the class detected for the image taken by its camera board on a continuous basis. I am unable to find anything related to that.

Project ID: 125691

Context/Use case: We want to identify some machined/molded parts and classify them

Hi @TheBluePhoenix,

Please see this API page on how to use the ei_impulse_result_t struct. After performing inference with ei_run_classifier(), the prediction results will be in that struct.

Specifically, I recommend looking at the example at the bottom of the page. There you will see how the prediction results are printed out. You can compare your prediction results to a threshold (e.g. if (result.classification[0].value > 0.5) { ... }) to determine if the image was classified as item 0 (whatever item is first in your labels list). From there, you can perform some kind of action.

Hope that helps!

Hello sir.
Thank you for your input. My main problem lies in getting the features on a continuous basis. Basically, I am having to input the feature matrix for every new image and I want to deploy my product so that after detecting a particular class the Spresense board produces an action. Similar to what the exported firmware does. However, it cannot be edited and I wanted to make some changes to it. The C/C++ firmware as I mentioned requires me to manually input a feature matrix for each new image. So how can I automate the feature matrix generation?

Hi @TheBluePhoenix,

You can start from our full Spresense firmware and then add your own logic to it. Data ingestion and classification is included in the source code.

Aurelien

Hello Sir,
I am trying to do the same by using an arduino library of the model for image classification.
code:

But the output displays an error:


Can you please help me regarding this error.