Data preparation for CNN

1 回表示 (過去 30 日間)
Rd
Rd 2020 年 11 月 1 日
コメント済み: Rd 2020 年 11 月 2 日
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.

採用された回答

Walter Roberson
Walter Roberson 2020 年 11 月 1 日
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 件のコメント
Rd
Rd 2020 年 11 月 2 日
Thank you for your response. If you find any ways to meet my need kindly let me know.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by