How do I control the output class of combine() with multiple image and trasnformedimage datastores?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Christopher Greulich
el 9 de Feb. de 2024
Editada: Christopher Greulich
el 12 de Feb. de 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 comentarios
Respuesta aceptada
Matt J
el 10 de Feb. de 2024
imdsTransformed = transform(imds,@(x) {imresize(x,targetSize)} );
1 comentario
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!