Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %this file is used to test the model in the unseen data to this model by
- %loading the trained model into the workking space
- load skin-cancer-model-alexnet.mat trainedNet
- digitDatasetPath = fullfile('C:\Users\UTStudent\Desktop\salari\salari-project\skin-cancer-dataset-test');
- imds = imageDatastore(digitDatasetPath, ...
- 'IncludeSubfolders',true,'LabelSource','foldernames');
- %finding number of images in the directorty of test
- numberofImages = length(imds.Files);
- idx = randperm(numel(imds.Files),numberofImages);
- %this loop here will clasify the unseen images to the model
- for i = 1:numberofImages
- subplot(2,2,i)
- I = readimage(imds,idx(i));
- actualLabel = imds.Labels(idx(i));
- predictedLabel = netTransfer.classify(I);
- imshow(I)
- title(['Predicted: ' char(predictedLabel) ', Actual: ' char(actualLabel)])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement