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: Inverse Fourier transform
  Args:
      fourier_coeff (ndarray): Fourier coefficients shaped (n, 2k+1),
          with n and k being candidates number and Fourier degree
          respectively.
      num_reconstr_points (int): Number of reconstructed polygon
          points. Defaults to 50.
  
  Returns:
      List[ndarray]: The reconstructed polygons.
docstr_tok: ["Inverse","Fourier","transform","Args",":","fourier_coeff","(","ndarray",")",":","Fourier","coefficients","shaped","(","n",",","2k+1",")",",","with","n","and","k","being","candidates","number","and","Fourier","degree","respectively",".","num_reconstr_points","(","int",")",":","Number","of","reconstructed","polygon","points",".","Defaults","to","50",".","Returns",":","List","[","ndarray","]",":","The","reconstructed","polygons","."]
code: def _fourier2poly(
      self, fourier_coeff: np.ndarray, num_reconstr_points: int = 50
  ):
      """Inverse Fourier transform
      Args:
          fourier_coeff (ndarray): Fourier coefficients shaped (n, 2k+1),
              with n and k being candidates number and Fourier degree
              respectively.
          num_reconstr_points (int): Number of reconstructed polygon
              points. Defaults to 50.
  
      Returns:
          List[ndarray]: The reconstructed polygons.
      """
  
      a = np.zeros(
          (len(fourier_coeff), num_reconstr_points), dtype="complex"
      )
      k = (len(fourier_coeff[0]) - 1) // 2
  
      a[:, 0 : k + 1] = fourier_coeff[:, k:]
      a[:, -k:] = fourier_coeff[:, :k]
  
      poly_complex = ifft(a) * num_reconstr_points
      polygon = np.zeros((len(fourier_coeff), num_reconstr_points, 2))
      polygon[:, :, 0] = poly_complex.real
      polygon[:, :, 1] = poly_complex.imag
      return (
          polygon.astype("int32")
          .reshape((len(fourier_coeff), -1))
          .tolist()
      )
  
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 5 for calling the FCEPostprocessor obj's underlying member method code with example usage: obj._fourier2poly(fourier_coeff, num_reconstr_points) and returns: polygon