class_docstr: Decoding predictions of FCENet to instances.
  
  Args:
      fourier_degree (int): The maximum Fourier transform degree k.
      num_reconstr_points (int): The points number of the polygon
          reconstructed from predicted Fourier coefficients.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          ['polygons'].
      scales (list[int]) : The down-sample scale of each layer. Defaults
          to [8, 16, 32].
      text_repr_type (str): Boundary encoding type 'poly' or 'quad'. Defaults
          to 'poly'.
       alpha (float): The parameter to calculate final scores
          :math:`Score_{final} = (Score_{text region} ^ alpha)
          * (Score_{text center_region}^ beta)`. Defaults to 1.0.
      beta (float): The parameter to calculate final score. Defaults to 2.0.
      score_thr (float): The threshold used to filter out the final
          candidates.Defaults to 0.3.
      nms_thr (float): The threshold of nms. Defaults to 0.1.
class_docstr_tok: ["Decoding","predictions","of","FCENet","to","instances",".","Args",":","fourier_degree","(","int",")",":","The","maximum","Fourier","transform","degree","k.","num_reconstr_points","(","int",")",":","The","points","number","of","the","polygon","reconstructed","from","predicted","Fourier","coefficients",".","rescale_fields","(","list","[","str","]",")",":","The","bbox\/polygon","field","names","to","be","rescaled",".","If","None",",","no","rescaling","will","be","performed",".","Defaults","to","[","'polygons","'","]",".","scales","(","list","[","int","]",")",":","The","down-sample","scale","of","each","layer",".","Defaults","to","[","8",",","16",",","32","]",".","text_repr_type","(","str",")",":","Boundary","encoding","type","'poly","'","or","'quad","'",".","Defaults","to","'poly","'",".","alpha","(","float",")",":","The","parameter","to","calculate","final","scores",":","math",":","`","Score_","{","final","}","=","(","Score_","{","text","region","}","^","alpha",")","*","(","Score_","{","text","center_region","}","^","beta",")","`",".","Defaults","to","1.0.","beta","(","float",")",":","The","parameter","to","calculate","final","score",".","Defaults","to","2.0.","score_thr","(","float",")",":","The","threshold","used","to","filter","out","the","final","candidates.Defaults","to","0.3.","nms_thr","(","float",")",":","The","threshold","of","nms",".","Defaults","to","0.1","."]
docstr: Split batched elements in pred_results along the first dimension
  into ``batch_num`` sub-elements and regather them into a list of dicts.
  
  Args:
      pred_results (list[dict]): A list of dict with keys of ``cls_res``,
          ``reg_res`` corresponding to the classification result and
          regression result computed from the input tensor with the
          same index. They have the shapes of :math:`(N, C_{cls,i},
          H_i, W_i)` and :math:`(N, C_{out,i}, H_i, W_i)`.
  
  Returns:
      list[list[dict]]: N lists. Each list contains three dicts from
      different feature level.
docstr_tok: ["Split","batched","elements","in","pred_results","along","the","first","dimension","into","``","batch_num","``","sub-elements","and","regather","them","into","a","list","of","dicts",".","Args",":","pred_results","(","list","[","dict","]",")",":","A","list","of","dict","with","keys","of","``","cls_res","``",",","``","reg_res","``","corresponding","to","the","classification","result","and","regression","result","computed","from","the","input","tensor","with","the","same","index",".","They","have","the","shapes","of",":","math",":","`","(","N",",","C_","{","cls",",","i","}",",","H_i",",","W_i",")","`","and",":","math",":","`","(","N",",","C_","{","out",",","i","}",",","H_i",",","W_i",")","`",".","Returns",":","list","[","list","[","dict","]","]",":","N","lists",".","Each","list","contains","three","dicts","from","different","feature","level","."]
code: def split_results(self, pred_results: List[Dict]) -> List[List[Dict]]:
      """Split batched elements in pred_results along the first dimension
      into ``batch_num`` sub-elements and regather them into a list of dicts.
  
      Args:
          pred_results (list[dict]): A list of dict with keys of ``cls_res``,
              ``reg_res`` corresponding to the classification result and
              regression result computed from the input tensor with the
              same index. They have the shapes of :math:`(N, C_{cls,i},
              H_i, W_i)` and :math:`(N, C_{out,i}, H_i, W_i)`.
  
      Returns:
          list[list[dict]]: N lists. Each list contains three dicts from
          different feature level.
      """
      assert isinstance(pred_results, list) and len(
          pred_results
      ) == len(self.scales)
  
      fields = list(pred_results[0].keys())
      batch_num = len(pred_results[0][fields[0]])
      level_num = len(pred_results)
      results = []
      for i in range(batch_num):
          batch_list = []
          for level in range(level_num):
              feat_dict = {}
              for field in fields:
                  feat_dict[field] = pred_results[level][field][i]
              batch_list.append(feat_dict)
          results.append(batch_list)
      return results
  
file_path: mmocr/mmocr/models/textdet/postprocessors/fce_postprocessor.py
imports: from typing import Dict, List, Sequence
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from numpy.fft import ifft
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import fill_hole
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 2 for calling the FCEPostprocessor obj's underlying member method code with example usage: obj.split_results(pred_results) and returns: results