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 Center および File ExchangeImage Data Workflows についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by