yolov3 detect image

1 次查看(过去 30 天)
sam ho
sam ho 2020-11-14
回答: Isee You 2021-5-10
I am useing the yolov3 detect sample
i want to detect my image but have some problem
it seems not match the yolov3Detect Xtest type
please helpe me
aaaa=imread('vehicleImage.jpg');
% Convert to dlarray.
aaaa=single(aaaa);
XTest = dlarray(aaaa, 'SSCB');
executionEnvironment = "auto";
[bboxes, scores, labels] = yolov3Detect(net, XTest, networkOutputs, anchorBoxes, anchorBoxMasks, confidenceThreshold, overlapThreshold, classNames);
clear yolov3Detect
if ~isempty(scores{1})
I = insertObjectAnnotation(aaaa, 'rectangle', bboxes{1}, scores{1});
end
figure('Name','detect')
imshow(I)

回答(1 个)

Isee You
Isee You 2021-5-10
i = imread(fullFileName);
confidenceThreshold = 0.7;
overlapThreshold = 0.5;
i=imresize(i,networkInputSize(1:2));
i=im2single(i);
XTest = dlarray(i,'SSCB');
if (executionEnvironment == "auto" && canUseGPU) || executionEnvironment == "gpu"
XTest = gpuArray(XTest);
end
[bboxes, scores, labels] = yolov3Detect(net, XTest, networkOutputs, anchorBoxes,anchorBoxMasks, confidenceThreshold, overlapThreshold, classNames);

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by