@Gaurav_Pandey  you can easily adapt a dataset to handle co_transforms in the __call__ function (e.g. see this gist which has general structure that handles co_transforms):

  
      gist.github.com
  
  
    https://gist.github.com/ncullen93/14b458cb4bd237bab2a41a185f710808 553
co_classes.py
"""
Custom datasets from both in-memory and out-of-memory data
"""

import torch.utils.data as data

from PIL import Image
import os
import os.path

This file has been truncated. show original




  
  
    
    
  
  


and here are some relevant affine transforms to actually use – you’ll see the transforms must take in two arguments for the input and target images:

  
      gist.github.com
  
  
    https://gist.github.com/ncullen93/425ca642955f73452ebc097b3b46c493 182
affine_transforms.py
"""
Affine transforms implemented on torch tensors, and
only requiring one interpolation

Included:
- Affine()
- AffineCompose()
- Rotation()
- Translation()
- Shear()
This file has been truncated. show original