필터 지우기
필터 지우기

How to import a trained object detector to Simulink?

조회 수: 3 (최근 30일)
Chandni S Vijay
Chandni S Vijay 2022년 11월 28일
편집: Ashu 2023년 1월 25일
Hi. I have trained an object detector using trainYOLOv4ObjectDetector() function and now I want to add this detector to my Simulink model to detect the objects from the images I pass through in the Simulink model. Is there any way to import it? I tried using Deep learning object detector block but its not working. Could someone guide me through this?

채택된 답변

Ashu
Ashu 2023년 1월 24일
편집: Ashu 2023년 1월 25일
Hi Chandni,
You can use a MATLAB Function block in simulink to load the trained object detector .
To work with MATLAB Function block you can refer :
Inside the function you can have your custom code and make predictions like this
% Assuming trainedDetector.mat is the saved object detector
trainedDetector = load('trainedDetector.mat', 'trainedDetector')
I = imread('highway.png');
[bboxes, scores, labels] = detect(trainedDetector,I,Threshold=0.05);
detectedImg = insertObjectAnnotation(I,"Rectangle",bboxes,labels);
To read more about loading different types of variables, you can refer
To learn more about YoloV4ObjectDetector, you can refer

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by