class_docstr: Default formatting bundle.
  
  It simplifies the pipeline of formatting common fields, including "img"
  and "gt_semantic_seg". These fields are formatted as follows.
  
  - img: (1)transpose, (2)to tensor, (3)to DataContainer (stack=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","''","and","``","gt_semantic_seg","''",".","These","fields","are","formatted","as","follows",".","-","img",":","(","1",")","transpose",",","(","2",")","to","tensor",",","(","3",")","to","DataContainer","(","stack=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"]
          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)
      if "gt_semantic_seg" in results:
          # convert to long
          results["gt_semantic_seg"] = DC(
              to_tensor(
                  results["gt_semantic_seg"][None, ...].astype(np.int64)
              ),
              stack=True,
          )
      return results
  
imports: from collections.abc import Sequence
  import annotator.uniformer.mmcv
  import numpy
  import torch
  from annotator.uniformer.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