class_docstr: Default formatting bundle.
  
  It simplifies the pipeline of formatting common fields, including "img",
  "proposals", "gt_bboxes", "gt_labels", "gt_masks" and "gt_semantic_seg".
  These fields are formatted as follows.
  
  - img: (1)transpose, (2)to tensor, (3)to DataContainer (stack=True)
  - proposals: (1)to tensor, (2)to DataContainer
  - gt_bboxes: (1)to tensor, (2)to DataContainer
  - gt_bboxes_ignore: (1)to tensor, (2)to DataContainer
  - gt_labels: (1)to tensor, (2)to DataContainer
  - gt_masks: (1)to tensor, (2)to DataContainer (cpu_only=True)
  - gt_semantic_seg: (1)unsqueeze dim-0 (2)to tensor,                        (3)to DataContainer (stack=True)
class_docstr_tok: ["Default","formatting","bundle",".","It","simplifies","the","pipeline","of","formatting","common","fields",",","including","``","img","''",",","''","proposals","''",",","``","gt_bboxes","''",",","``","gt_labels","''",",","``","gt_masks","''","and","``","gt_semantic_seg","''",".","These","fields","are","formatted","as","follows",".","-","img",":","(","1",")","transpose",",","(","2",")","to","tensor",",","(","3",")","to","DataContainer","(","stack=True",")","-","proposals",":","(","1",")","to","tensor",",","(","2",")","to","DataContainer","-","gt_bboxes",":","(","1",")","to","tensor",",","(","2",")","to","DataContainer","-","gt_bboxes_ignore",":","(","1",")","to","tensor",",","(","2",")","to","DataContainer","-","gt_labels",":","(","1",")","to","tensor",",","(","2",")","to","DataContainer","-","gt_masks",":","(","1",")","to","tensor",",","(","2",")","to","DataContainer","(","cpu_only=True",")","-","gt_semantic_seg",":","(","1",")","unsqueeze","dim-0","(","2",")","to","tensor",",","(","3",")","to","DataContainer","(","stack=True",")"]
docstr: Call function to transform and format common fields in results.
  
  Args:
      results (dict): Result dict contains the data to convert.
  
  Returns:
      dict: The result dict contains the data that is formatted with                 default bundle.
docstr_tok: ["Call","function","to","transform","and","format","common","fields","in","results",".","Args",":","results","(","dict",")",":","Result","dict","contains","the","data","to","convert",".","Returns",":","dict",":","The","result","dict","contains","the","data","that","is","formatted","with","default","bundle","."]
code: def __call__(self, results):
      """Call function to transform and format common fields in results.
  
          Args:
              results (dict): Result dict contains the data to convert.
  
          Returns:
              dict: The result dict contains the data that is formatted with \
                  default bundle.
          """
  
      if "img" in results:
          img = results["img"]
          # add default meta keys
          results = self._add_default_meta_keys(results)
          if len(img.shape) < 3:
              img = np.expand_dims(img, -1)
          img = np.ascontiguousarray(img.transpose(2, 0, 1))
          results["img"] = DC(to_tensor(img), stack=True)
      for key in [
          "proposals",
          "gt_bboxes",
          "gt_bboxes_ignore",
          "gt_keypointss",
          "gt_labels",
      ]:
          if key not in results:
              continue
          results[key] = DC(to_tensor(results[key]))
      if "gt_masks" in results:
          results["gt_masks"] = DC(results["gt_masks"], cpu_only=True)
      if "gt_semantic_seg" in results:
          results["gt_semantic_seg"] = DC(
              to_tensor(results["gt_semantic_seg"][None, ...]),
              stack=True,
          )
      return results
  
imports: from collections.abc import Sequence
  import mmcv
  import numpy
  import torch
  from mmcv.parallel import DataContainer
  from ..builder import PIPELINES
label_desc: Use image node_id 1 for calling the DefaultFormatBundle obj's underlying member method code with example usage: obj.__call__(results) and returns: results