필터 지우기
필터 지우기

How can I see the predicted labels for all my validation set images? I used deep network designer to modify a pre-trained network .

조회 수: 3 (최근 30일)
Hi,
So I used Deep Network Designer ( DND) to modify GoogleNet and do some transfer learning on a new dataset. I separated the data into training vs validation, again using the DND. When the transfer learning process has ended, I obtained an accuracy of 97. Now, my issue is the deployment of the results. I need a code that gives me a file with all the images and the predcited class and its percentage.
For the moment I only have this
idx = randperm(numel(imdsValidation.Files),4);
figure
for i = 1:4
subplot(2,2,i)
I = readimage(imdsValidation,idx(i));
imshow(I)
label = YPred(idx(i));
title(string(label) + ", " + num2str(100*max(probs(idx(i),:)),3) + "%");
end
But obsly if I adapted it for hundreds of images does not work.
Please let us know if there is any possibility to deploy all the validation images with the class predicted.
Thanks a lot,
Andreea

답변 (1개)

Prince Kumar
Prince Kumar 2021년 11월 17일
You can pass all the validation set as a batch to get the all predictions at once instead of doing it one by one.
For example:
[YPred,probs] = classify(net,imdsValidation);
Here net can be any network which you trained.
For a full example you can have a look at this link :

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by