class_docstr: The callable currently does the following:
  
  1. Read the image from "file_name" and label from "pan_seg_file_name"
  2. Applies random scale, crop and flip transforms to image and label
  3. Prepare data to Tensor and generate training targets from label
class_docstr_tok: ["The","callable","currently","does","the","following",":","1",".","Read","the","image","from","``","file_name","''","and","label","from","``","pan_seg_file_name","''","2",".","Applies","random","scale",",","crop","and","flip","transforms","to","image","and","label","3",".","Prepare","data","to","Tensor","and","generate","training","targets","from","label"]
code: def from_config(cls, cfg):
      augs = [
          T.ResizeShortestEdge(
              cfg.INPUT.MIN_SIZE_TRAIN,
              cfg.INPUT.MAX_SIZE_TRAIN,
              cfg.INPUT.MIN_SIZE_TRAIN_SAMPLING,
          )
      ]
      if cfg.INPUT.CROP.ENABLED:
          augs.append(
              T.RandomCrop(cfg.INPUT.CROP.TYPE, cfg.INPUT.CROP.SIZE)
          )
      augs.append(T.RandomFlip())
  
      # Assume always applies to the training set.
      dataset_names = cfg.DATASETS.TRAIN
      meta = MetadataCatalog.get(dataset_names[0])
      panoptic_target_generator = PanopticDeepLabTargetGenerator(
          ignore_label=meta.ignore_label,
          thing_ids=list(
              meta.thing_dataset_id_to_contiguous_id.values()
          ),
          sigma=cfg.INPUT.GAUSSIAN_SIGMA,
          ignore_stuff_in_offset=cfg.INPUT.IGNORE_STUFF_IN_OFFSET,
          small_instance_area=cfg.INPUT.SMALL_INSTANCE_AREA,
          small_instance_weight=cfg.INPUT.SMALL_INSTANCE_WEIGHT,
          ignore_crowd_in_semantic=cfg.INPUT.IGNORE_CROWD_IN_SEMANTIC,
      )
  
      ret = {
          "augmentations": augs,
          "image_format": cfg.INPUT.FORMAT,
          "panoptic_target_generator": panoptic_target_generator,
      }
      return ret
  
file_path: detectron2/projects/Panoptic-DeepLab/panoptic_deeplab/dataset_mapper.py
imports: import copy
  import logging
  import numpy
  from typing import Callable, List, Union
  import torch
  from panopticapi.utils import rgb2id
  from detectron2.config import configurable
  from detectron2.data import MetadataCatalog
  from detectron2.data import detection_utils
  from detectron2.data import transforms
  from .target_generator import PanopticDeepLabTargetGenerator
label_desc: Use image node_id 2 for calling the PanopticDeeplabDatasetMapper obj's underlying member method code with example usage: obj.from_config(cls, cfg) and returns: ret