How can I see the predicted labels for all my validation set images? I used deep network designer to modify a pre-trained network .
1 回表示 (過去 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
0 件のコメント
回答 (1 件)
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 :
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!