item_tfms
do not create a bigger dataset. If you pass multiple ones, they are composed. You still have the same number of images in your dataset.
dls.show_batch()
will always show you the augmented version.
Why item_tfms and batch_tfms why not just batch_tfms ? Since all transforms are on the individual images.Or am i missing something?
Thanks, how many more pictures will add to our dataloader?
No. As their name indicates, batch_tfms
are applied to a batch of images at a time.
We look at the DataBlock source code at Source Code study group and created videos for each session.
https://forums.fast.ai/t/source-code-mid-level-api/65755
This forum post also contains multiple exmaple of DataBlock API including reading four channel images/multilabel audio/5 different single image single label similar to bears and pets examples.
Is the idea of randomResizedCrop that you’ll make multiple copies of the same photo with different parts/versions included all at once? Or are you randomResizing every photo once?
None. You still have the same pictures. What a transform might do (if it does data augmentation) is to return a different result each time you ask for the image. But transforms do not add new raw items (aka new filenames).
Can you use methods like RandomResizedCrop to increase the size of your training set?
thank you so much
You will have one new version of it per epoch, each time you iterate through your data.
Why do we have both batch_tfms are also applied on images aren’t they
How is the RandomResizedCrop be applied to validation data?
Based on my understanding, in each epoch, the image will be cropped to a small area of the image and zoomed in. I may be wrong though.
It’s a center crop.
The min_scale takes 30% of the image at the time… is there an industry percentage that is recommended to use here?
How can we add diffferent augmentations for Train and Validation set?
My understanding is:
batch_tfms applies the SAME transform to all images in your batch.
item_tfms applies different transforms to all images in your batch.
See: https://forums.fast.ai/t/lesson-3-official-topic/67244/64?u=joshvarty
This is effectively what it’s doing. The model sees a lot more variations of the input images than if you didn’t have this randomized transform.