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: Add default meta keys.
  
  We set default meta keys including `pad_shape`, `scale_factor` and
  `img_norm_cfg` to avoid the case where no `Resize`, `Normalize` and
  `Pad` are implemented during the whole pipeline.
  
  Args:
      results (dict): Result dict contains the data to convert.
  
  Returns:
      results (dict): Updated result dict contains the data to convert.
docstr_tok: ["Add","default","meta","keys",".","We","set","default","meta","keys","including","`","pad_shape","`",",","`","scale_factor","`","and","`","img_norm_cfg","`","to","avoid","the","case","where","no","`","Resize","`",",","`","Normalize","`","and","`","Pad","`","are","implemented","during","the","whole","pipeline",".","Args",":","results","(","dict",")",":","Result","dict","contains","the","data","to","convert",".","Returns",":","results","(","dict",")",":","Updated","result","dict","contains","the","data","to","convert","."]
code: def _add_default_meta_keys(self, results):
      """Add default meta keys.
  
      We set default meta keys including `pad_shape`, `scale_factor` and
      `img_norm_cfg` to avoid the case where no `Resize`, `Normalize` and
      `Pad` are implemented during the whole pipeline.
  
      Args:
          results (dict): Result dict contains the data to convert.
  
      Returns:
          results (dict): Updated result dict contains the data to convert.
      """
      img = results["img"]
      results.setdefault("pad_shape", img.shape)
      results.setdefault("scale_factor", 1.0)
      num_channels = 1 if len(img.shape) < 3 else img.shape[2]
      results.setdefault(
          "img_norm_cfg",
          dict(
              mean=np.zeros(num_channels, dtype=np.float32),
              std=np.ones(num_channels, dtype=np.float32),
              to_rgb=False,
          ),
      )
      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 2 for calling the DefaultFormatBundle obj's underlying member method code with example usage: obj._add_default_meta_keys(results) and returns: results