Import Object Detector Model into Simulink

2 views (last 30 days)
Jack Gilbert
Jack Gilbert on 21 May 2024
Edited: Malay Agarwal on 22 May 2024
BLUF: I want to integrate a Yolov4 Object detector into Simulink
I'm currently working on a project involving multiple vision detection methods to identify and track a target option. I'm using Simulink along with the computer vision and image processing toolboxes to analyse videos to pull out target object and its location.
I'd like to implement a Yolov4 Object Detector into my simulink model. I have made a dataset, and trained the model, and have saved the trained object detection system to a .mat file. MY ISSUE: is that I can't seem to import the object detection object/system/structure into my simulink model. The common error is that the load() function throwing an unsupported class.
Currently I am trying to improt the object through the load function in a MATLAB_Function block. Is Simulink capable of importing this object? Cna it be done through standard blocks, or will I need to create a custom function to overcome the load function? Should I do it through the workspace instead?
Open to any and all suggestions, thank you for your help.

Answers (1)

Malay Agarwal
Malay Agarwal on 21 May 2024
Edited: Malay Agarwal on 22 May 2024
I understand that you want to use a trained "YOLOv4" model in Simulink as a block.
Since MATLAB R2021b, there is a block called “Deep Learning Object Detector” which can be used to import an object detection model from a MAT-file into Simulink and use it as a block. Please refer to the documentation on how you can use the block: https://www.mathworks.com/help/vision/ref/deeplearningobjectdetector.html.
You can also refer to the following link for an example showing how to use the block: https://www.mathworks.com/help/deeplearning/ug/lane-vehicle-detection-simulink-using-predict-block.html.
Hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!