You can use Albumentations library. It’s very straight forward to use and supports image with different type of targets.
  
      

      albumentations.ai
  

  
    

Albumentations Documentation - Mask augmentation for segmentation 1

  Albumentations: fast and flexible image augmentations


  

  
    
    
  

  



  
      

      albumentations.ai
  

  
    

Albumentations Documentation - Keypoints augmentation

  Albumentations: fast and flexible image augmentations