# How to find number of images for training after augmentation?

I have used this transformation. However, when I print the number of samples for training, it is showing the same number of images I have. I want to know the number of images after the augmentation? Can any one please tell me how to find the number of images after augmentation? Thanks in advance.

``````train_transforms = transforms.Compose([transforms.RandomResizedCrop(size=224, interpolation=2),
transforms.Resize((224,224)),
transforms.RandomHorizontalFlip(),
transforms.RandomRotation(15),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])
])

test_transforms = transforms.Compose([
transforms.Resize((224,224)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])
])
merge_data = datasets.ImageFolder(data_dir + "/train", transform=train_transforms)

train_data, valid_data = train_test_split(merge_data, test_size = 0.2, random_state= 123)
test_data= datasets.ImageFolder(test_dir,transform=test_transforms)
num_workers = 0
print("Number of Samples in Train: ",len(train_data))
print("Number of Samples in Valid: ",len(valid_data))
print("Number of Samples in Test ",len(test_data))
num_workers=num_workers)
num_workers=num_workers)
``````

Well, I’m not sure if I understood what you are willing to do but, as far as I know, the Pytorch dataset is making the transformation while you are training.
Which means, for now, non of your images where transformed.
But, you can see the size of your dataset by calling the method len()
in your code: train_data. _ _len _ _ ()
Regardless to that, you can iterate over the train/test loaders, you will get number of values and labels as your batch size after the transformation. It is like seeing how your data will be feed into your model.
If your dataset only returns x (value) and y (label). you can write this: