Input image data directly from Variable and not DataStore?

5 次查看(过去 30 天)
I've got neural data that I'm using to create the 'images' for a CNN model. I have a 4 dimensional array where the first 3 dimensions are the X,Y,RGB values, and the 4th is the image index (ex 1:107,000). Can I port this directly into Matlab's CNN models? So far I have to use the data to create PNGs in test/train folders, then import using the example from 'Create simple Deep Learning Network...' provided by Matlab's documentation, but it would be so much more efficient to pipe the data directly.

采纳的回答

Travis Meyer
Travis Meyer 2022-10-2
Got it!!! It's actually easier than expected, I can pass the 4D array directly into trainNetwork, even without using arraydatastore. I typed 'edit trainNetwork' and read through the comments and this one explained a good amount of the steps:
% trainedNet = trainNetwork(X, Y, layers, options) trains and returns a
% network, trainedNet. The format of X depends on the input layer.
% - For an image input layer, X is a numeric array of images arranged
% so that the first three dimensions are the width, height and
% channels, and the last dimension indexes the individual images.
% - For a 3-D image input layer, X is a numeric array of 3-D images
% with the dimensions width, height, depth, channels, and the last
% dimension indexes the individual observations.

更多回答(1 个)

Walter Roberson
Walter Roberson 2022-10-1

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by