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 =
  test_subsampler =
  trainloader =
                      batch_size=batch_size, sampler=train_subsampler)
  testloader =
                      batch_size=batch_size, sampler=test_subsampler)
  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.