cuixing158 / yoloX-yoloV5-onnx-matlab

Simple reasoning code, just run demo.mlx
MIT License
45 stars 6 forks source link

Problems with using own onnx #3

Open niklas121 opened 3 years ago

niklas121 commented 3 years ago

Dear Sir, I have a problem using my own onnx file. The code works fine with your model:

model = 'yolov5s_DL.onnx';
customYoloV5FcnName = 'yolov5fcn';
inputSize = [640,640];
throushHold = 0.3;
nmsThroushHold = 0.4;
outs = cell(3,1);
classesNames = categorical(readlines("coco.names"));
colors = randi(255,length(classesNames),3); params = importONNXFunction(model,customYoloV5FcnName);

yolov5_DL

But if i use my own onnx file, exported to [480 640] I get the follwing results:

model = 'yolov5s_480_640.onnx'; customYoloV5FcnName = 'yolov5fcn'; inputSize = [480,640]; throushHold = 0.3; nmsThroushHold = 0.4; outs = cell(3,1); classesNames = categorical(readlines("coco.names")); colors = randi(255,length(classesNames),3); params = importONNXFunction(model,customYoloV5FcnName);

yolov5_480_640

Do you have an idea wether this is due to my onnx export or the Matlab implementation?

Are there factors that I have to note in my onnx export?

I also changed the subfunction, but it still works with the standart yolov5.

inputSizeX = 480; %(640 for standart) inputSizeY = 640; scaledX = inputSizeX./oriWidth; scaledY = inputSizeY./oriHight;

kind regards

havefunheehee commented 2 years ago

Hello, I also had a similar problem, after using my own trained model, a bunch of wrong recognition boxes appeared. Do you have a solution to this problem?