Preparing a datastore for a multi-input CNN
2 次查看(过去 30 天)
显示 更早的评论
I have written the following code based on a question and answer on mathworks website. The problem is that the resulting datastore has only one row:
root_train='E:\DeepNet\Combined\tr';
trdatstore = imageDatastore(root_train,'IncludeSubfolders',true,'LabelSource','foldernames');
imds = trdatstore;
augimdsTrain = augmentedImageDatastore([224 224 3],imds)
augimdsTrain.MiniBatchSize =1
taugimdsTrain = transform(augimdsTrain,@(x)x{1,1})
labelsTrain = transform(augimdsTrain,@(x){x{1,2}})
cds = combine(taugimdsTrain,taugimdsTrain,labelsTrain)
0 个评论
回答(1 个)
yanqi liu
2021-12-24
visiondataPath = fullfile(matlabroot,'toolbox','vision','visiondata');
trdatstore = imageDatastore(visiondataPath,'IncludeSubfolders',true,'LabelSource','foldernames');
imds = trdatstore;
augimdsTrain = augmentedImageDatastore([224 224 3],imds)
augimdsTrain.MiniBatchSize =1
taugimdsTrain = transform(augimdsTrain,@(x)x{1,1})
labelsTrain = transform(augimdsTrain,@(x){x{1,2}})
cds = combine(taugimdsTrain,taugimdsTrain,labelsTrain)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!