augmentedImageDatastore, understanding the flow of how it works

조회 수: 4(최근 30일)
James Latshaw
James Latshaw 2021년 12월 11일
답변: James Latshaw 2021년 12월 13일
I have a few question about the augmentedImageDatastore() function. I understand that this can be used to help preprocess images to help my network learn. However, there are still a few things that are not clear to me so I thought that I would ask them here.
1) Does augmentedImageDatastore() apply the augmentations to each batch of images? So during an iteration, by network will load N images which will be my minimatch. It will apply this image agumentation (to those N images only), and then run them throuhg my network. Is this correct, specifically the augmentations happen on each mini batch and not the entire dataset?
2) My traing images are an odd shape. They are tiff images which are 1x1024x2. The output of the augmentImageDatastore appears to be reformating the images so that the are 1x1024. How can I prevent this?
3) If I am running matlab 2020a, what options do I have for using custom image augmentations? Most of the examples that I see are for later versions of matlab. Do you know of any examples that are 2020a compatible?
4) If I have a GPU available, how can I use the GPU to perform these preprocessing with augmentedImageDatastore()?
Thank you very much for your help.
You are the best!

채택된 답변

Joss Knight
Joss Knight 2021년 12월 12일
1) Yes
2) What is that 3rd dimension? Is this an index image? I think augmentedImageDatastore only understands grayscale and RGB images.
3) imageDataAugmenter lets you perform a range of standard transformations. Otherwise you should use a transform. Consult
4) Use a transform and make use of gpuArray.

추가 답변(1개)

James Latshaw
James Latshaw 2021년 12월 13일
Hi Joss,
My image data is actually 2 grayscale images stacked on top of each other which is tracked by the 3rd dimention.
The transform(....) looks like the way to go. I was wrong, I assumed that the transform modifies the entire dataset at once. However, it only changes that batch of training data (which is what I wanted). So for future readers, tansform(...) with a custom function using a gpuArray(...) is the way to go :)
Thank you for your help!

Community Treasure Hunt

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

Start Hunting!

Translated by