I want to create a dataset of my own like CIFAR-10 ?
2 次查看(过去 30 天)
显示 更早的评论
I want to create a dataset of my own like CIFAR-10 but not with RGB values but CEDD feature vector of image. I am creating a imageDatastore and reading the images and thier labels with following code :
imageFolder = fullfile('G:\9th Semester\Project - 2\myDataset');
imds = imageDatastore(imageFolder,'LabelSource', 'foldernames', 'IncludeSubfolders',true);
[trainingSet , testingSet] = splitEachLabel(imds , 0.8 , 'randomize');
trainingSet = shuffle(trainingSet);
testingSet = shuffle(testingSet);
data = [];
labels = char.empty(0,10);
cedd = [];
for i=1:size(trainingSet.Files)
image = readimage(trainingSet,i);
cedd = CEDD(image);
zerosCount = 0 ;
for j=1:144
if cedd(j) == 0
zerosCount=zerosCount + 1;
end
end
if zerosCount ~= 144
data(i , :) = cedd;
labels(i ,: ) = trainingSet.Labels(i);
end
end
save('train.mat' , 'data' , 'labels');
But is giving me this error. Any help will be much appreciated !
Unable to perform assignment because the size of the left side is 1-by-10 and the size of the right side is 1-by-3.
Error in dataset (line 20)
labels(i ,: ) = trainingSet.Labels(i);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!