Data preparation for CNN

2 visualizzazioni (ultimi 30 giorni)
Rd
Rd il 1 Nov 2020
Commentato: Rd il 2 Nov 2020
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.

Risposta accettata

Walter Roberson
Walter Roberson il 1 Nov 2020
That kind of datastore does not have any documented method of retrieving the associated category information.
(I am not at my desk so I do not know if there is an undocumented public method or a private property with the information.)
  1 Commento
Rd
Rd il 2 Nov 2020
Thank you for your response. If you find any ways to meet my need kindly let me know.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by