I am getting error in function imds=imageDatastore(fullfile(rootFolder, categories), 'LabelSource', 'foldernames'); why?
2 次查看(过去 30 天)
显示 更早的评论
i am getting an error for above code in matlab 2016a
9 个评论
回答(2 个)
Walter Roberson
2016-6-1
You removed some of the code that is needed to download data. Go back to http://www.mathworks.com/examples/matlab-computer-vision/mw/vision_product-DeepLearningImageClassificationExample-image-category-classification-using-deep-learning and pull out the entire code.
In particular you need the lines
if ~exist(outputFolder, 'dir') % download only once
disp('Downloading 126MB Caltech101 data set...');
untar(url, outputFolder);
end
and
% Location of pre-trained "AlexNet"
cnnURL = 'http://www.vlfeat.org/matconvnet/models/beta16/imagenet-caffe-alex.mat';
and
if ~exist(cnnMatFile, 'file') % download only once
disp('Downloading pre-trained CNN model...');
websave(cnnMatFile, cnnURL);
end
0 个评论
Arthur
2018-4-6
Consider to adapt your code to:
path = char(path) %pass to this variable your complet data set path
categories = {'airplanes', 'ferry', 'laptop'};
imds = imageDatastore(fullfile(path, categories), 'LabelSource', 'foldernames');
tbl = countEachLabel(imds);
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!