class_docstr: A callable which takes a dataset dict in Detectron2 Dataset format,
  and map it into a format used by DETR.
  
  The callable currently does the following:
  
  1. Read the image from "file_name"
  2. Applies geometric transforms to the image and annotation
  3. Find and applies suitable cropping to the image and annotation
  4. Prepare image and annotation to Tensors
class_docstr_tok: ["A","callable","which","takes","a","dataset","dict","in","Detectron2","Dataset","format",",","and","map","it","into","a","format","used","by","DETR",".","The","callable","currently","does","the","following",":","1",".","Read","the","image","from","``","file_name","''","2",".","Applies","geometric","transforms","to","the","image","and","annotation","3",".","Find","and","applies","suitable","cropping","to","the","image","and","annotation","4",".","Prepare","image","and","annotation","to","Tensors"]
code: def __init__(self, cfg, is_train=True):
      if cfg.INPUT.CROP.ENABLED and is_train:
          self.crop_gen = [
              T.ResizeShortestEdge(
                  [400, 500, 600], sample_style="choice"
              ),
              T.RandomCrop(cfg.INPUT.CROP.TYPE, cfg.INPUT.CROP.SIZE),
          ]
      else:
          self.crop_gen = None
  
      self.mask_on = cfg.MODEL.MASK_ON
      self.tfm_gens = build_transform_gen(cfg, is_train)
      logging.getLogger(__name__).info(
          "Full TransformGens used in training: {}, crop: {}".format(
              str(self.tfm_gens), str(self.crop_gen)
          )
      )
  
      self.img_format = cfg.INPUT.FORMAT
      self.is_train = is_train
  
file_path: detr/d2/detr/dataset_mapper.py
imports: import copy
  import logging
  import numpy
  import torch
  from detectron2.data import detection_utils
  from detectron2.data import transforms
  from detectron2.data.transforms import TransformGen
label_desc: Use image node_id 1 to create a new DetrDatasetMapper object  with example: obj = DetrDatasetMapper(cfg, is_train)