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","."]
code: def _get_preds_single_level(
      self,
      priors,
      cls_scores,
      bbox_preds,
      centernesses,
      bezier_preds=None,
      stride=1,
      score_thr=0,
      nms_pre=-1,
      img_shape=None,
  ):
      assert cls_scores.size()[-2:] == bbox_preds.size()[-2:]
      if self.norm_by_strides:
          bbox_preds = bbox_preds * stride
      bbox_preds = bbox_preds.permute(1, 2, 0).reshape(-1, 4)
      if self.with_bezier:
          if self.norm_by_strides:
              bezier_preds = bezier_preds * stride
          bezier_preds = bezier_preds.permute(1, 2, 0).reshape(-1, 8, 2)
      centernesses = centernesses.permute(1, 2, 0).reshape(-1).sigmoid()
      cls_scores = cls_scores.permute(1, 2, 0).reshape(
          -1, self.cls_out_channels
      )
      if self.use_sigmoid_cls:
          scores = cls_scores.sigmoid()
      else:
          # remind that we set FG labels to [0, num_class-1]
          # since mmdet v2.0
          # BG cat_id: num_class
          scores = cls_scores.softmax(-1)[:, :-1]
  
      # After https://github.com/open-mmlab/mmdetection/pull/6268/,
      # this operation keeps fewer bboxes under the same `nms_pre`.
      # There is no difference in performance for most models. If you
      # find a slight drop in performance, you can set a larger
      # `nms_pre` than before.
      results = filter_scores_and_topk(
          scores,
          score_thr,
          nms_pre,
          dict(bbox_preds=bbox_preds, priors=priors),
      )
      scores, labels, keep_idxs, filtered_results = results
  
      bbox_preds = filtered_results["bbox_preds"]
      priors = filtered_results["priors"]
      centernesses = centernesses[keep_idxs]
      bboxes = self.bbox_coder.decode(
          priors, bbox_preds, max_shape=img_shape
      )
      if self.with_bezier:
          bezier_preds = bezier_preds[keep_idxs]
          bezier_preds = priors[:, None, :] + bezier_preds
          bezier_preds[:, :, 0].clamp_(min=0, max=img_shape[1])
          bezier_preds[:, :, 1].clamp_(min=0, max=img_shape[0])
          return bboxes, scores, labels, centernesses, bezier_preds
      else:
          return bboxes, scores, labels, centernesses
  
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 4 for calling the ABCNetDetPostprocessor obj's underlying member method code with example usage: obj._get_preds_single_level(priors, cls_scores, bbox_preds, centernesses, bezier_preds, stride, score_thr, nms_pre, img_shape) and returns: bboxes,  scores,  labels,  centernesses,  bezier_preds, bboxes,  scores,  labels,  centernesses