class_docstr: Base class for the MS COCO Object Detection Dataset. Sub-classes should implement
  training and validation transform functions.
  
  Args:
      opts: command-line arguments
  
  .. note::
      This class implements basic functions (e.g., reading image and annotations), and does not implement
      training/validation transforms. Detector specific sub-classes should extend this class and implement those
      methods. See `coco_ssd.py` as an example for SSD.
class_docstr_tok: ["Base","class","for","the","MS","COCO","Object","Detection","Dataset",".","Sub-classes","should","implement","training","and","validation","transform","functions",".","Args",":","opts",":","command-line","arguments","..","note",":",":","This","class","implements","basic","functions","(","e.g.",",","reading","image","and","annotations",")",",","and","does","not","implement","training\/validation","transforms",".","Detector","specific","sub-classes","should","extend","this","class","and","implement","those","methods",".","See","`","coco_ssd.py","`","as","an","example","for","SSD","."]
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"]["box_labels"]: Shape is [Num of boxes]
      output_data["targets"]["box_coordinates"]: Shape is [Num of boxes, 4]
      output_data["targets"]["image_id"]: Shape is [1]
      output_data["targets"]["image_width"]: Shape is [1]
      output_data["targets"]["image_height"]: Shape is [1]
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","''","]","[","``","box_labels","''","]",":","Shape","is","[","Num","of","boxes","]","output_data","[","``","targets","''","]","[","``","box_coordinates","''","]",":","Shape","is","[","Num","of","boxes",",","4","]","output_data","[","``","targets","''","]","[","``","image_id","''","]",":","Shape","is","[","1","]","output_data","[","``","targets","''","]","[","``","image_width","''","]",":","Shape","is","[","1","]","output_data","[","``","targets","''","]","[","``","image_height","''","]",":","Shape","is","[","1","]"]
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"]["box_labels"]: Shape is [Num of boxes]
          output_data["targets"]["box_coordinates"]: Shape is [Num of boxes, 4]
          output_data["targets"]["image_id"]: Shape is [1]
          output_data["targets"]["image_width"]: Shape is [1]
          output_data["targets"]["image_height"]: Shape is [1]
      """
  
      crop_size_h, crop_size_w, img_index = sample_size_and_index
  
      transform_fn = self.get_augmentation_transforms(
          size=(crop_size_h, crop_size_w)
      )
  
      image_id = self.ids[img_index]
  
      image, img_name = self.get_image(image_id=image_id)
      im_width, im_height = image.size
  
      boxes, labels, mask = self.get_boxes_and_labels(
          image_id=image_id,
          image_width=im_width,
          image_height=im_height,
          include_masks=True,
      )
  
      data = {
          "image": image,
          "box_labels": labels,
          "box_coordinates": boxes,
          "mask": mask,
      }
  
      if transform_fn is not None:
          data = transform_fn(data)
  
      output_data = {
          "samples": {
              "image": data["image"],
          },
          "targets": {
              "box_labels": data["box_labels"],
              "box_coordinates": data["box_coordinates"],
              "mask": data["mask"],
              "image_id": torch.tensor(image_id),
              "image_width": torch.tensor(im_width),
              "image_height": torch.tensor(im_height),
          },
      }
  
      return output_data
  
imports: import argparse
  import os
  from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
  import numpy
  import torch
  from pycocotools import mask
  from pycocotools.coco import COCO
  from torch import Tensor
  from data.datasets import DATASET_REGISTRY
  from data.datasets.detection.base_detection import BaseDetectionDataset
  from data.transforms import image_pil
  from data.transforms.common import Compose
  from utils import logger
label_desc: Use image node_id 5 for calling the COCODetection obj's underlying member method code with example usage: obj.__getitem__(sample_size_and_index) and returns: output_data