class_docstr: Post-processing methods for ABCNet.
  
  Args:
      num_classes (int): Number of classes.
      use_sigmoid_cls (bool): Whether to use sigmoid for classification.
      strides (tuple): Strides of each feature map.
      norm_by_strides (bool): Whether to normalize the regression targets by
          the strides.
      bbox_coder (dict): Config dict for bbox coder.
      text_repr_type (str): Text representation type, 'poly' or 'quad'.
      with_bezier (bool): Whether to use bezier curve for text detection.
      train_cfg (dict): Config dict for training.
      test_cfg (dict): Config dict for testing.
class_docstr_tok: ["Post-processing","methods","for","ABCNet",".","Args",":","num_classes","(","int",")",":","Number","of","classes",".","use_sigmoid_cls","(","bool",")",":","Whether","to","use","sigmoid","for","classification",".","strides","(","tuple",")",":","Strides","of","each","feature","map",".","norm_by_strides","(","bool",")",":","Whether","to","normalize","the","regression","targets","by","the","strides",".","bbox_coder","(","dict",")",":","Config","dict","for","bbox","coder",".","text_repr_type","(","str",")",":","Text","representation","type",",","'poly","'","or","'quad","'",".","with_bezier","(","bool",")",":","Whether","to","use","bezier","curve","for","text","detection",".","train_cfg","(","dict",")",":","Config","dict","for","training",".","test_cfg","(","dict",")",":","Config","dict","for","testing","."]
docstr: Postprocess pred_results according to metainfos in data_samples.
  
  Args:
      pred_results (Union[Tensor, List[Tensor]]): The prediction results
          stored in a tensor or a list of tensor. Usually each item to
          be post-processed is expected to be a batched tensor.
      data_samples (list[TextDetDataSample]): Batch of data_samples,
          each corresponding to a prediction result.
      training (bool): Whether the model is in training mode. Defaults to
          False.
  
  Returns:
      list[TextDetDataSample]: Batch of post-processed datasamples.
docstr_tok: ["Postprocess","pred_results","according","to","metainfos","in","data_samples",".","Args",":","pred_results","(","Union","[","Tensor",",","List","[","Tensor","]","]",")",":","The","prediction","results","stored","in","a","tensor","or","a","list","of","tensor",".","Usually","each","item","to","be","post-processed","is","expected","to","be","a","batched","tensor",".","data_samples","(","list","[","TextDetDataSample","]",")",":","Batch","of","data_samples",",","each","corresponding","to","a","prediction","result",".","training","(","bool",")",":","Whether","the","model","is","in","training","mode",".","Defaults","to","False",".","Returns",":","list","[","TextDetDataSample","]",":","Batch","of","post-processed","datasamples","."]
code: def __call__(
      self, pred_results, data_samples, training: bool = False
  ):
      """Postprocess pred_results according to metainfos in data_samples.
  
      Args:
          pred_results (Union[Tensor, List[Tensor]]): The prediction results
              stored in a tensor or a list of tensor. Usually each item to
              be post-processed is expected to be a batched tensor.
          data_samples (list[TextDetDataSample]): Batch of data_samples,
              each corresponding to a prediction result.
          training (bool): Whether the model is in training mode. Defaults to
              False.
  
      Returns:
          list[TextDetDataSample]: Batch of post-processed datasamples.
      """
      if training:
          return data_samples
      cfg = self.train_cfg if training else self.test_cfg
      if cfg is None:
          cfg = {}
      pred_results = self.split_results(pred_results)
      process_single = partial(self._process_single, **cfg)
      results = list(map(process_single, pred_results, data_samples))
  
      return results
  
file_path: mmocr/projects/ABCNet/abcnet/model/abcnet_det_postprocessor.py
imports: from functools import partial
  from typing import List
  import numpy
  import torch
  from mmcv.ops import batched_nms
  from mmdet.models.task_modules.prior_generators import MlvlPointGenerator
  from mmdet.models.utils import filter_scores_and_topk, multi_apply, select_single_mlvl
  from mmengine.structures import InstanceData
  from mmocr.models.textdet.postprocessors.base import BaseTextDetPostProcessor
  from mmocr.registry import MODELS, TASK_UTILS
label_desc: Use image node_id 5 for calling the ABCNetDetPostprocessor obj's underlying member method code with example usage: obj.__call__(pred_results, data_samples, training) and returns: results, data_samples