I want to create a dataset of my own like CIFAR-10 ?
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!