Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
Unsolved Object Detection using TF Lite Micro on Sony Spresense
-
Hi,
I am trying to deploy YOLOv4 Object Detection model on the Sony Spresense.
I have converted it to
.cc
format but am not clear as to how to run object detection using TF Lite Micro on the Spresense for my own custom model.None of the 3 examples cover object detection and I am looking for tutorial to follow on how to run custom object detection model (YOLOv4) on spresense.
Any guidance would be helpful.
Note: I tried to modify the
person_detection
example by editing it to use my.cc
model data, but I got the this error:make[2]: warning: Clock skew detected. Your build may be incomplete.
-
I trained my yolov5 model for my usecase. How can I transfer my .tflite object detection model to the spresense.
-
Hey, @rauna
If you don't mind, I'll copy the same answer I gave in the Hackster discussion boardHave you already checked this example? -> https://developer.sony.com/develop/spresense/docs/sdk_tutorials_en.html#_tflmrt_sample_application
There is a note on section 5.1.4. Operation check about using your own model.
Since you have already trained your model, you can skip section 5.1.2. Train a TensorFlow Lite model.
I believe you can use this application, but modify how it processes the output tensor.
This is the code for the application:
https://github.com/sonydevworld/spresense/blob/master/examples/tflmrt_lenet/tflmrt_lenet_main.cThe output tensor is
TfLiteTensor *var = tflm_runtime_output_variable(rt, 0);Here you can see some helper functions to work with the output tensor:
https://github.com/sonydevworld/spresense/blob/master/sdk/modules/include/tflmrt/runtime.h
Like tflm_runtime_output_num, tflm_runtime_output_shape, tflm_runtime_output_ndim, etc..