docstr: Propose text components.
  
  Args:
      score_map (ndarray): The score map for NMS.
      top_height_map (ndarray): The predicted text height map from each
          pixel in text center region to top sideline.
      bot_height_map (ndarray): The predicted text height map from each
          pixel in text center region to bottom sideline.
      sin_map (ndarray): The predicted sin(theta) map.
      cos_map (ndarray): The predicted cos(theta) map.
      comp_score_thr (float): The score threshold of text component.
      min_width (float): The minimum width of text components.
      max_width (float): The maximum width of text components.
      comp_shrink_ratio (float): The shrink ratio of text components.
      comp_w_h_ratio (float): The width to height ratio of text
          components.
  
  Returns:
      text_comps (ndarray): The text components.
docstr_tok: ["Propose","text","components",".","Args",":","score_map","(","ndarray",")",":","The","score","map","for","NMS",".","top_height_map","(","ndarray",")",":","The","predicted","text","height","map","from","each","pixel","in","text","center","region","to","top","sideline",".","bot_height_map","(","ndarray",")",":","The","predicted","text","height","map","from","each","pixel","in","text","center","region","to","bottom","sideline",".","sin_map","(","ndarray",")",":","The","predicted","sin","(","theta",")","map",".","cos_map","(","ndarray",")",":","The","predicted","cos","(","theta",")","map",".","comp_score_thr","(","float",")",":","The","score","threshold","of","text","component",".","min_width","(","float",")",":","The","minimum","width","of","text","components",".","max_width","(","float",")",":","The","maximum","width","of","text","components",".","comp_shrink_ratio","(","float",")",":","The","shrink","ratio","of","text","components",".","comp_w_h_ratio","(","float",")",":","The","width","to","height","ratio","of","text","components",".","Returns",":","text_comps","(","ndarray",")",":","The","text","components","."]
code: def propose_comps(
      self,
      score_map,
      top_height_map,
      bot_height_map,
      sin_map,
      cos_map,
      comp_score_thr,
      min_width,
      max_width,
      comp_shrink_ratio,
      comp_w_h_ratio,
  ):
      """Propose text components.
  
      Args:
          score_map (ndarray): The score map for NMS.
          top_height_map (ndarray): The predicted text height map from each
              pixel in text center region to top sideline.
          bot_height_map (ndarray): The predicted text height map from each
              pixel in text center region to bottom sideline.
          sin_map (ndarray): The predicted sin(theta) map.
          cos_map (ndarray): The predicted cos(theta) map.
          comp_score_thr (float): The score threshold of text component.
          min_width (float): The minimum width of text components.
          max_width (float): The maximum width of text components.
          comp_shrink_ratio (float): The shrink ratio of text components.
          comp_w_h_ratio (float): The width to height ratio of text
              components.
  
      Returns:
          text_comps (ndarray): The text components.
      """
  
      comp_centers = np.argwhere(score_map > comp_score_thr)
      comp_centers = comp_centers[np.argsort(comp_centers[:, 0])]
      y = comp_centers[:, 0]
      x = comp_centers[:, 1]
  
      top_height = (
          top_height_map[y, x].reshape((-1, 1)) * comp_shrink_ratio
      )
      bot_height = (
          bot_height_map[y, x].reshape((-1, 1)) * comp_shrink_ratio
      )
      sin = sin_map[y, x].reshape((-1, 1))
      cos = cos_map[y, x].reshape((-1, 1))
  
      top_mid_pts = comp_centers + np.hstack(
          [top_height * sin, top_height * cos]
      )
      bot_mid_pts = comp_centers - np.hstack(
          [bot_height * sin, bot_height * cos]
      )
  
      width = (top_height + bot_height) * comp_w_h_ratio
      width = np.clip(width, min_width, max_width)
      r = width / 2
  
      tl = top_mid_pts[:, ::-1] - np.hstack([-r * sin, r * cos])
      tr = top_mid_pts[:, ::-1] + np.hstack([-r * sin, r * cos])
      br = bot_mid_pts[:, ::-1] + np.hstack([-r * sin, r * cos])
      bl = bot_mid_pts[:, ::-1] - np.hstack([-r * sin, r * cos])
      text_comps = np.hstack([tl, tr, br, bl]).astype(np.float32)
  
      score = score_map[y, x].reshape((-1, 1))
      text_comps = np.hstack([text_comps, score])
  
      return text_comps
  
file_path: PaddleOCR/ppocr/modeling/heads/proposal_local_graph.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import cv2
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from lanms import merge_quadrangle_n9
  from ppocr.ext_op import RoIAlignRotated
  from .local_graph import euclidean_distance_matrix, feature_embedding, normalize_adjacent_matrix
label_desc: Use image node_id 2 for calling the ProposalLocalGraphs obj's underlying member method code with example usage: obj.propose_comps(score_map, top_height_map, bot_height_map, sin_map, cos_map, comp_score_thr, min_width, max_width, comp_shrink_ratio, comp_w_h_ratio) and returns: text_comps