How to use YOLO v5 onnx model in MATLAB

Hello Everyone, I hope you are doing well. I have the trained onnx model of yolov5
https://drive.google.com/file/d/1YUoiafwC3AAHU15YVWjqeGDivTcDEniG/view?usp=sharing
I want to used it for prediction in MATLAB How can i do that?
I have used the following command but it gives error
modelfile = "yolov5s (1).onnx";
net = importONNXNetwork(modelfile)
%%
% Error using nnet.internal.cnn.onnx.importONNXNetwork>iHandleTranslationIssues (line 81)
% Unable to import the network because of the following issues:
%
% 1 operator(s) : Unable to create an output layer for ONNX network output #1 (with name 'output') because its data format is
% unknown or not supported as a MATLAB output layer. If you know the output format, pass it using the 'OutputDataFormats' parameter.
%
% To import the ONNX network as a dlnetwork, set the 'TargetNetwork' value to 'dlnetwork'.
%
% To import the ONNX network as a layer graph with weights, use importONNXLayers.
%
% To import the ONNX network as a function, use importONNXFunction.
%
% Error in nnet.internal.cnn.onnx.importONNXNetwork (line 37)
% iHandleTranslationIssues(translationIssues);
%
% Error in importONNXNetwork (line 113)
% Network = nnet.internal.cnn.onnx.importONNXNetwork(modelfile, varargin{:});
%%

Respuestas (1)

David Willingham
David Willingham el 24 de Ag. de 2022

0 votos

YOLO v5 has some layers that are currently not supported. However have you tried YOLOX? YOLOX is one of the best performing object detectors and is considered as an improvement to the existing YOLO variants such as YOLO v4, and YOLO v5.
YOLOX is available on GitHub here:Pretrained YOLOX Network For Object Detection

3 comentarios

Stephen john
Stephen john el 25 de Ag. de 2022
@David Willingham Did MATLAB supports YOLOX layers? How can i used YOLOX trained model in python in MATLAB
David Willingham
David Willingham el 25 de Ag. de 2022
Hi Stephen,
Are you able to provide the onnx file? my email is dwilling@mathworks.com. I can have our developers take a look at it and see if we can provide any example code for importing it to MATLAB.
Doron Joffe
Doron Joffe el 16 de En. de 2023
Editada: Doron Joffe el 16 de En. de 2023
Hi David,
I downloaded the Pretrained YOLOX Network For Object Detection from the GitHub repository. When running the code on Matlab, I am getting accuarate predictions, however it is very slow compared to the yolov4ObjectDetector. Is there a reason for this. It is, however more accurate.

Iniciar sesión para comentar.

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Productos

Versión

R2022a

Preguntada:

el 24 de Ag. de 2022

Editada:

el 16 de En. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by