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: Returns the sample corresponding to the input sample index. Returned sample is transformed
  into the size specified by the input.
  
  Args:
      sample_size_and_index: Tuple of the form (crop_size_h, crop_size_w, sample_index)
  
  Returns:
      A dictionary with `samples` and `targets` as keys corresponding to input and labels of
      a sample, respectively.
  
  Shapes:
      The shape of values in output dictionary, output_data, are as follows:
  
      output_data["samples"]["image"]: Shape is [Channels, Height, Width]
      output_data["targets"]["mask"]: Shape is [Height, Width]
docstr_tok: ["Returns","the","sample","corresponding","to","the","input","sample","index",".","Returned","sample","is","transformed","into","the","size","specified","by","the","input",".","Args",":","sample_size_and_index",":","Tuple","of","the","form","(","crop_size_h",",","crop_size_w",",","sample_index",")","Returns",":","A","dictionary","with","`","samples","`","and","`","targets","`","as","keys","corresponding","to","input","and","labels","of","a","sample",",","respectively",".","Shapes",":","The","shape","of","values","in","output","dictionary",",","output_data",",","are","as","follows",":","output_data","[","``","samples","''","]","[","``","image","''","]",":","Shape","is","[","Channels",",","Height",",","Width","]","output_data","[","``","targets","''","]","[","``","mask","''","]",":","Shape","is","[","Height",",","Width","]"]
code: def __getitem__(
      self, sample_size_and_index: Tuple[int, int, int], *args, **kwargs
  ) -> Mapping[str, Union[Tensor, Mapping[str, Tensor]]]:
      """Returns the sample corresponding to the input sample index. Returned sample is transformed
      into the size specified by the input.
  
      Args:
          sample_size_and_index: Tuple of the form (crop_size_h, crop_size_w, sample_index)
  
      Returns:
          A dictionary with `samples` and `targets` as keys corresponding to input and labels of
          a sample, respectively.
  
      Shapes:
          The shape of values in output dictionary, output_data, are as follows:
  
          output_data["samples"]["image"]: Shape is [Channels, Height, Width]
          output_data["targets"]["mask"]: Shape is [Height, Width]
      """
  
      crop_size_h, crop_size_w, img_index = sample_size_and_index
      transform = self.get_augmentation_transforms(
          size=(crop_size_h, crop_size_w)
      )
  
      mask = self.read_mask_pil(self.masks[img_index])
      img = self.read_image_pil(self.images[img_index])
  
      if (img.size[0] != mask.size[0]) or (img.size[1] != mask.size[1]):
          logger.error(
              "Input image and mask sizes are different. Input size: {} and Mask size: {}".format(
                  img.size, mask.size
              )
          )
  
      data = {"image": img}
      if not self.is_evaluation:
          data["mask"] = mask
  
      data = transform(data)
  
      if self.is_evaluation:
          # for evaluation purposes, resize only the input and not mask
          data["mask"] = self.convert_mask_to_tensor(mask)
  
      output_data = {
          "samples": data["image"],
          # ignore dataset specific indices in mask
          "targets": data["mask"] - self.adjust_mask_value(),
      }
  
      if self.is_evaluation:
          im_width, im_height = img.size
          img_name = (
              self.images[img_index]
              .split(os.sep)[-1]
              .replace("jpg", "png")
          )
          mask = output_data.pop("targets")
          output_data["targets"] = {
              "mask": mask,
              "file_name": img_name,
              "im_width": im_width,
              "im_height": im_height,
          }
  
      return output_data
  
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 13 for calling the BaseImageSegmentationDataset obj's underlying member method code with example usage: obj.__getitem__(sample_size_and_index) and returns: output_data