Data preparation for CNN
Mostrar comentarios más antiguos
I have image folder with 10 subfolders. Each subfolder contain 180 images.
I need to call first 60 images in each subfolder and store it in XTrain1 variable; middle 60 images and store it in XTrain2 variable; last 60 Images and store it in XTrain3 variable.
Each variable (XTrain1, XTrain2, XTrain3) should be 4D double.
I tried the following code.
close all;clear;clc
imagefolder = 'C:\Users\manjurama\Desktop\study\PG\PROJECT\Finger vein database multiple copy\database_10';
imds = imageDatastore(imagefolder,'IncludeSubfolders',true,'LabelSource','foldernames');
numTrainFiles = 0.75;
imageSize = [227 227];
[XTrain,YTrain] = splitEachLabel(imds, numTrainFiles,'randomize');
XTrain = augmentedImageDatastore(imageSize,XTrain);
YTrain = augmentedImageDatastore(imageSize,YTrain);
Xtrain1 = XTrain.Files(1:60);
XTrain2 = XTrain.Files(61:120);
XTrain3 = XTrain.Files(121:160);
classes = categories(YTrain);% retrieve the class information with the type of categorical
numClasses = numel(classes);
Following error i got:
The value assigned to variable XTrain2 might be unused.
checking for missing argument or incorrect argument data type in call to funtion 'categories'.
Anybody help me to solve the issue or suggest any alternatives. Thanks in advance for your help.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Object Detection en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!