class_docstr: Base Dataset class for Image Segmentation datasets. Sub-classes must define `ignore_label`
  and `background_idx` variable.
  
  Args:
      opts: Command-line arguments
class_docstr_tok: ["Base","Dataset","class","for","Image","Segmentation","datasets",".","Sub-classes","must","define","`","ignore_label","`","and","`","background_idx","`","variable",".","Args",":","opts",":","Command-line","arguments"]
docstr: Data augmentation during training.
  
  Order of transformation is RandomShortSizeResize, RandomHorizontalFlip, RandomCrop,
      Optional[RandomGaussianBlur], Optional[PhotometricDistort], Optional[RandomRotate].
  
  If random order is enabled, then the order of transforms is shuffled, with an exception to RandomShortSizeResize.
  These transforms are followed by ToTensor.
  
  Args:
      size: Size for resizing the input image. Expected to be a tuple (height, width)
  
  Returns:
      An instance of `data.transforms.image_pil.BaseTransformation.`
docstr_tok: ["Data","augmentation","during","training",".","Order","of","transformation","is","RandomShortSizeResize",",","RandomHorizontalFlip",",","RandomCrop",",","Optional","[","RandomGaussianBlur","]",",","Optional","[","PhotometricDistort","]",",","Optional","[","RandomRotate","]",".","If","random","order","is","enabled",",","then","the","order","of","transforms","is","shuffled",",","with","an","exception","to","RandomShortSizeResize",".","These","transforms","are","followed","by","ToTensor",".","Args",":","size",":","Size","for","resizing","the","input","image",".","Expected","to","be","a","tuple","(","height",",","width",")","Returns",":","An","instance","of","`","data.transforms.image_pil.BaseTransformation.","`"]
code: def _training_transforms(
      self, size: Tuple[int, int]
  ) -> T.BaseTransformation:
      """Data augmentation during training.
  
      Order of transformation is RandomShortSizeResize, RandomHorizontalFlip, RandomCrop,
          Optional[RandomGaussianBlur], Optional[PhotometricDistort], Optional[RandomRotate].
  
      If random order is enabled, then the order of transforms is shuffled, with an exception to RandomShortSizeResize.
      These transforms are followed by ToTensor.
  
      Args:
          size: Size for resizing the input image. Expected to be a tuple (height, width)
  
      Returns:
          An instance of `data.transforms.image_pil.BaseTransformation.`
      """
      first_aug = T.RandomShortSizeResize(opts=self.opts)
      aug_list = [
          T.RandomHorizontalFlip(opts=self.opts),
          T.RandomCrop(
              opts=self.opts, size=size, ignore_idx=self.ignore_label
          ),
      ]
  
      if getattr(
          self.opts, "image_augmentation.random_gaussian_noise.enable"
      ):
          aug_list.append(T.RandomGaussianBlur(opts=self.opts))
  
      if getattr(
          self.opts, "image_augmentation.photo_metric_distort.enable"
      ):
          aug_list.append(T.PhotometricDistort(opts=self.opts))
  
      if getattr(self.opts, "image_augmentation.random_rotate.enable"):
          aug_list.append(T.RandomRotate(opts=self.opts))
  
      if getattr(self.opts, "image_augmentation.random_order.enable"):
          new_aug_list = [
              first_aug,
              T.RandomOrder(opts=self.opts, img_transforms=aug_list),
              T.ToTensor(opts=self.opts),
          ]
          return Compose(opts=self.opts, img_transforms=new_aug_list)
      else:
          aug_list.insert(0, first_aug)
          aug_list.append(T.ToTensor(opts=self.opts))
          return Compose(opts=self.opts, img_transforms=aug_list)
  
imports: import argparse
  import os
  from typing import List, Mapping, Optional, Tuple, Union
  import numpy
  import torch
  from PIL import Image
  from torch import Tensor
  from data.datasets.dataset_base import BaseImageDataset
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from utils import logger
  from utils.color_map import Colormap
label_desc: Use image node_id 4 for calling the BaseImageSegmentationDataset obj's underlying member method code with example usage: obj._training_transforms(size) and returns: Compose, Compose