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 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