Set union of Datastores with TransformedDatastores

1 vue (au cours des 30 derniers jours)
Matt J
Matt J le 26 Juil 2019
Given an imageDatastore and some transformation of it, e.g.,
imds1 = imageDatastore({'street1.jpg','peppers.png'});
imds2 = transform(imds1,@(x) imwarp(x,tform));
I would like to form the set union of these data stores in some way so that trainNetwork processes the series of images from both imds1 and imds2 as a single combined set (and similarly with the response data). Is this possible in some way?
I am aware that this functionality is somewhat captured by augmentedImageDatastore, but the operation I describe would open up a variety of data augmentation schemes not currently avaialble.
I am also aware of this thread,
but this does not cover what I am pursuing here, because the images in a TransformedDatastore are not physically stored anywhere (nor would I want them to be).

Réponse acceptée

Jeremy Hughes
Jeremy Hughes le 26 Juil 2019
Modifié(e) : Jeremy Hughes le 26 Juil 2019
Horizontal (i.e. associated reads)
-----------
cds = combine(imds,otherds);
Vertical (i.e. joining two sets of files into one datastore)
-----------
imds = imageDatastore({'folder1/*.jpg','folder2/*.png'});
Or leave off the extensions
imds = imageDatastore({'folder1/','folder2/'});
  7 commentaires
Matt J
Matt J le 26 Juil 2019
Modifié(e) : Matt J le 26 Juil 2019
That looks like what I want!
Just out of curiousity, though, is it possible to do the customization by inheriting from imageDatastore, rather than matlab.io.datastore, as the example at your link shows?
Carlos Ramirez
Carlos Ramirez le 8 Sep 2020
Modifié(e) : Carlos Ramirez le 8 Sep 2020
Hi, did you ever manage to solve this ?. I don't really understand what's the purpose of the function combine(idms,idms2) (with idms2 being a transformed one) if later the read function returns two images at the same time. How useful is that for training a CNN using trainNetwork ?. Similat to the original question, I do not want to physically store the augmented images created by the transform function. Any help ?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by