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 testing/evaluation.
  
  Order of transformation is Optional[Resize], ToTensor
  
  Args:
      size: Size for resizing the input image. Expected to be an int or a tuple (height, width)
  
  Returns:
      An instance of `data.transforms.image_pil.BaseTransformation.`
  
  ...note::
      When `evaluation.segmentation.resize_input_images` is enabled, then images are resized
          while maintaining the aspect ratio. If size is a tuple of integers, then min(size)
          is used as a size.
  
      When `evaluation.segmentation.resize_input_images_fixed_size` is enabled, then images
          are resized to the given size.
docstr_tok: ["Data","augmentation","during","testing\/evaluation",".","Order","of","transformation","is","Optional","[","Resize","]",",","ToTensor","Args",":","size",":","Size","for","resizing","the","input","image",".","Expected","to","be","an","int","or","a","tuple","(","height",",","width",")","Returns",":","An","instance","of","`","data.transforms.image_pil.BaseTransformation.","`","...","note",":",":","When","`","evaluation.segmentation.resize_input_images","`","is","enabled",",","then","images","are","resized","while","maintaining","the","aspect","ratio",".","If","size","is","a","tuple","of","integers",",","then","min","(","size",")","is","used","as","a","size",".","When","`","evaluation.segmentation.resize_input_images_fixed_size","`","is","enabled",",","then","images","are","resized","to","the","given","size","."]
code: def _evaluation_transforms(
      self, size: Union[int, Tuple[int, int]], *args, **kwargs
  ) -> T.BaseTransformation:
      """Data augmentation during testing/evaluation.
  
      Order of transformation is Optional[Resize], ToTensor
  
      Args:
          size: Size for resizing the input image. Expected to be an int or a tuple (height, width)
  
      Returns:
          An instance of `data.transforms.image_pil.BaseTransformation.`
  
      ...note::
          When `evaluation.segmentation.resize_input_images` is enabled, then images are resized
              while maintaining the aspect ratio. If size is a tuple of integers, then min(size)
              is used as a size.
  
          When `evaluation.segmentation.resize_input_images_fixed_size` is enabled, then images
              are resized to the given size.
  
      """
      aug_list = []
  
      resize_maintain_ar = getattr(
          self.opts, "evaluation.segmentation.resize_input_images"
      )
      resize_fixed_size = getattr(
          self.opts,
          "evaluation.segmentation.resize_input_images_fixed_size",
      )
  
      if resize_maintain_ar:
          assert resize_fixed_size is False
          # A standard practice for tasks of segmentation is to resize images while maintaining
          # aspect ratio. To do so during evaluation, we pass min(img_size) as size as an
          # argument to resize function. The resize function then resizes image while
          # maintaining aspect ratio.
          aug_list.append(T.Resize(opts=self.opts, img_size=min(size)))
      elif resize_fixed_size:
          assert resize_maintain_ar is False
          # we want to resize while maintaining aspect ratio. So, we pass size as an
          # argument to resize function
          aug_list.append(T.Resize(opts=self.opts, img_size=size))
      # default is no resizing
      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 6 for calling the BaseImageSegmentationDataset obj's underlying member method code with example usage: obj._evaluation_transforms(size) and returns: Compose