class_docstr: Sampler implementation that converts predictions to GT using registered
  samplers for different fields of `Instances`.
docstr: Transform model output into ground truth data through sampling
  
  Args:
    model_output (Dict[str, Any]): model output
  Returns:
    Dict[str, Any]: sampled data
docstr_tok: ["Transform","model","output","into","ground","truth","data","through","sampling","Args",":","model_output","(","Dict","[","str",",","Any","]",")",":","model","output","Returns",":","Dict","[","str",",","Any","]",":","sampled","data"]
code: def __call__(
      self, model_output: List[ModelOutput]
  ) -> List[SampledData]:
      """
      Transform model output into ground truth data through sampling
  
      Args:
        model_output (Dict[str, Any]): model output
      Returns:
        Dict[str, Any]: sampled data
      """
      for model_output_i in model_output:
          instances: Instances = model_output_i["instances"]
          # transform data in each field
          for _, sampler in self._samplers.items():
              if not instances.has(sampler.src) or sampler.dst is None:
                  continue
              if sampler.func is None:
                  instances.set(sampler.dst, instances.get(sampler.src))
              else:
                  instances.set(sampler.dst, sampler.func(instances))
          # delete model output data that was transformed
          for _, sampler in self._samplers.items():
              if sampler.src != sampler.dst and instances.has(
                  sampler.src
              ):
                  instances.remove(sampler.src)
          model_output_i["dataset"] = self.dataset_name
      return model_output
  
file_path: detectron2/projects/DensePose/densepose/data/samplers/prediction_to_gt.py
imports: from dataclasses import dataclass
  from typing import Any, Callable, Dict, List, Optional
  from detectron2.structures import Instances
label_desc: Use image node_id 2 for calling the PredictionToGroundTruthSampler obj's underlying member method code with example usage: obj.__call__(model_output) and returns: model_output