How do I control the output class of combine() with multiple image and trasnformedimage datastores?
2 views (last 30 days)
Show older comments
Christopher Greulich
on 9 Feb 2024
Edited: Christopher Greulich
on 12 Feb 2024
I am trying to train an image to image regression network. I have a series of input and output images in different folders. I create seperate imagedatastore for each folder than use combine() to create the input for the network. When I use combine on the two datastores as long as one of them is a pure imageDataStore the output is a cell array as trainnetwork() expects, but if both imagedatastores are also transformed than the output becomes an array concating the two images.
Minimal reproducible code:
dataDir = fullfile(toolboxdir('vision'),'visiondata','triangleImages');
imageDir = fullfile(dataDir,'trainingImages');
imds = imageDatastore(imageDir);
targetSize = [224,224];
imdsTransformed = transform(imds,@(x) imresize(x,targetSize));
combinedDS1 = combine(imdsTransformed, imds);
combinedDS2 = combine(imdsTransformed, imdsTransformed);
response1 = preview(combinedDS1);
response2 = preview(combinedDS2);
whos response1
whos response2
Given that the folders are dozens of gigabytes and I only want to transform the output image to do some proof of concept and parameter tuning exiperements, I don't want to save whole new batch of images to disk. Any way I can get combine() to concate two transformedDataStore and output a cell array?
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!