Input image data directly from Variable and not DataStore?

5 ビュー (過去 30 日間)
Travis Meyer
Travis Meyer 2022 年 10 月 1 日
回答済み: Travis Meyer 2022 年 10 月 2 日
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 日
  1 件のコメント
Travis Meyer
Travis Meyer 2022 年 10 月 1 日
Thanks I'll give it a try and see if trainNetwork accepts it!

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

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by