Hi Shaida!



 ShaidaMuhammad:

Is there any built-in way in PyTorch to augment this dataset? i.e. cropping the images randomly or changing their orientation or doing some other transformations to those training images


Yes, but you do have to write just a little bit of code.
Take a look at torchvision.transforms 2.  You might also work through
parts of the Writing Custom Datasets 3 tutorial.
The basic idea is that before you pass a batch of images to your
model you apply various random transforms to your images.
Every time you run an epoch (iterate through your dataset) you
will get a different set of random transforms (applied, of course,
to the same original images in your dataset).
You could, of course, build in advance a larger, augmented dataset
that includes your original images as well as transformed images,
and then train on that normally,  But it seems like less of a bother
just to apply the transforms on the fly.
Best.
K. Frank