AMB82-min Customized AI model

Hi,

sorry for asking but i can’t get a customized YOLOv7 model to work if i follow the instructions Customized AI model Installation Guide. I’d like to use a customized model WITHIN the project folder.

https://www.amebaiot.com/en/amebapro2-apply-ai-model-docs/

For Windows user,
C:\Users\USERNAME\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\VERSION\libraries\NeuralNetwork\examples
Or user customized project folder with “.ino” file.

##############################
My project folder looks like this:

C:\Users<USERAME>\Documents\Arduino\AMB82_min_HTTP_JPEG_Stream_testproj>dir
Volume in drive C has no label.
Volume Serial Number is 7830-6629

Directory of C:\Users<USERNAME>\Documents\Arduino\AMB82_min_HTTP_JPEG_Stream_testproj

20.12.2023 09:05 .
19.12.2023 21:44 …
20.12.2023 09:09 15.067 AMB82_min_HTTP_JPEG_Stream_testproj.ino
20.12.2023 09:09 465 ObjectClassList.h
19.12.2023 19:17 41.696 yolov7_tiny.nb

3 File(s) 5.157.228 bytes
2 Dir(s) 133.887.967.232 bytes free

C:\Users<USERAME>\Documents\Arduino\AMB82_min_HTTP_JPEG_Stream_testproj>

##############################
Compiling via arduinio ide 2.2.1 throws an error:

[Error] Model missing. Please check your sketch folder again.

//ObjDet.modelSelect(OBJECT_DETECTION, DEFAULT_YOLOV7TINY, NA_MODEL, NA_MODEL);
ObjDet.modelSelect(OBJECT_DETECTION, CUSTOMIZED_YOLOV7TINY, NA_MODEL, NA_MODEL);

##############################
basically the customized model works as expected, but only if i am copying my customized NB file to

AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6-build20231208\variants\common_nn_models*yolov7_tiny.nb*
(overwirte the original/default .nb file)

and use

ObjDet.modelSelect(OBJECT_DETECTION, DEFAULT_YOLOV7TINY, NA_MODEL, NA_MODEL);

##############################
Can you please let me know if i am missing something?

Thanks
Thomas

Hi @moschtrain,

Firstly, you need to add your project in AmebaPro2 Arduino SDK. For example in C:\Users\ {USERNAME}\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6-build20231220\libraries\NeuralNetwork\examples

Next, to apply your customized YOLO v7 model, you need to include it in your project folder as shown below. Your model need to be renamed to “yolov7_tiny.nb”.

and in your code,
Modify to ObjDet.modelSelect(OBJECT_DETECTION, CUSTOMIZED_YOLOV7TINY , NA_MODEL, NA_MODEL);

Thanks for the information

one more question please - what do you mean (the help article above) with “Or user customized project folder with “.ino” file.”

From my understanding this would be something like
C:\Users{USERAME}Documents\Arduino\AMB82_min_HTTP_JPEG_Stream_testproj>

User customized project folder with “.ino” file means your own projects that you have included in the Ameba Arduino SDK (C:\Users\USERNAME\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\VERSION\libraries\NeuralNetwork\examples) instead of those default examples in the SDK.

Thank you for your feedback, we will update the guide to make it more understandable :slight_smile: