class_docstr: The class for DBNet head.
  
  This was partially adapted from https://github.com/MhLiao/DB
  
  Args:
      in_channels (int): The number of input channels.
      with_bias (bool): Whether add bias in Conv2d layer. Defaults to False.
      module_loss (dict): Config of loss for dbnet. Defaults to
          ``dict(type='DBModuleLoss')``
      postprocessor (dict): Config of postprocessor for dbnet.
      init_cfg (dict or list[dict], optional): Initialization configs.
class_docstr_tok: ["The","class","for","DBNet","head",".","This","was","partially","adapted","from","https",":","\/\/github.com\/MhLiao\/DB","Args",":","in_channels","(","int",")",":","The","number","of","input","channels",".","with_bias","(","bool",")",":","Whether","add","bias","in","Conv2d","layer",".","Defaults","to","False",".","module_loss","(","dict",")",":","Config","of","loss","for","dbnet",".","Defaults","to","``","dict","(","type='DBModuleLoss","'",")","``","postprocessor","(","dict",")",":","Config","of","postprocessor","for","dbnet",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","configs","."]
docstr: Perform forward propagation of the detection head and predict
  detection results on the features of the upstream network.
  
  Args:
      x (tuple[Tensor]): Multi-level features from the
          upstream network, each is a 4D-tensor.
      batch_data_samples (List[:obj:`DetDataSample`]): The Data
          Samples. It usually includes information such as
          `gt_instance`, `gt_panoptic_seg` and `gt_sem_seg`.
  
  Returns:
      SampleList: Detection results of each image
      after the post process.
docstr_tok: ["Perform","forward","propagation","of","the","detection","head","and","predict","detection","results","on","the","features","of","the","upstream","network",".","Args",":","x","(","tuple","[","Tensor","]",")",":","Multi-level","features","from","the","upstream","network",",","each","is","a","4D-tensor",".","batch_data_samples","(","List","[",":","obj",":","`","DetDataSample","`","]",")",":","The","Data","Samples",".","It","usually","includes","information","such","as","`","gt_instance","`",",","`","gt_panoptic_seg","`","and","`","gt_sem_seg","`",".","Returns",":","SampleList",":","Detection","results","of","each","image","after","the","post","process","."]
code: def predict(
      self, x: torch.Tensor, batch_data_samples: DetSampleList
  ) -> DetSampleList:
      """Perform forward propagation of the detection head and predict
      detection results on the features of the upstream network.
  
      Args:
          x (tuple[Tensor]): Multi-level features from the
              upstream network, each is a 4D-tensor.
          batch_data_samples (List[:obj:`DetDataSample`]): The Data
              Samples. It usually includes information such as
              `gt_instance`, `gt_panoptic_seg` and `gt_sem_seg`.
  
      Returns:
          SampleList: Detection results of each image
          after the post process.
      """
      outs = self(x, batch_data_samples, mode="predict")
      predictions = self.postprocessor(outs, batch_data_samples)
      return predictions
  
file_path: mmocr/mmocr/models/textdet/heads/db_head.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from mmengine.model import Sequential
  from torch import Tensor
  from mmocr.models.textdet.heads import BaseTextDetHead
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils.typing_utils import DetSampleList
label_desc: Use image node_id 7 for calling the DBHead obj's underlying member method code with example usage: obj.predict(x, batch_data_samples) and returns: predictions