How to do image data augmentation with k-fold cross validation

Hello everyone, I was wondering if there was a solution on doing image data augmentation on just the training data. I have the k-fold setup

for fold,(train_idx,test_idx) in enumerate(kfold.split(dataset)):
  print('------------fold no---------{}----------------------'.format(fold))
  train_subsampler = torch.utils.data.SubsetRandomSampler(train_idx)
  test_subsampler = torch.utils.data.SubsetRandomSampler(test_idx)
 
  trainloader = torch.utils.data.DataLoader(
                      dataset, 
                      batch_size=batch_size, sampler=train_subsampler)
  testloader = torch.utils.data.DataLoader(
                      dataset,
                      batch_size=batch_size, sampler=test_subsampler)
 
  model.apply(reset_weights)
 
  for epoch in range(1, epochs + 1):
    train(fold, model, device, trainloader, optimizer, epoch)
    test(fold,model, device, testloader)

But during those folds, I am unable to find a way to augment just the training data just before the trainloader.

I see that other posts from years ago has not been answered. Has there been any update to this?

Thank you!

This post might be helpful.