class_docstr: Propose text components and generate local graphs for GCN to classify
  the k-nearest neighbors of a pivot in `DRRG: Deep Relational Reasoning
  Graph Network for Arbitrary Shape Text Detection.
  
  <https://arxiv.org/abs/2003.07493>`_.
  
  This code was partially adapted from https://github.com/GXYM/DRRG licensed
  under the MIT license.
  
  Args:
      k_at_hops (tuple(int)): The number of i-hop neighbors, i = 1, 2.
      num_adjacent_linkages (int): The number of linkages when constructing
          adjacent matrix.
      node_geo_feat_len (int): The length of embedded geometric feature
          vector of a text component.
      pooling_scale (float): The spatial scale of rotated RoI-Align.
      pooling_output_size (tuple(int)): The output size of rotated RoI-Align.
      nms_thr (float): The locality-aware NMS threshold for text components.
      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.
      comp_score_thr (float): The score threshold of text component.
      text_region_thr (float): The threshold for text region probability map.
      center_region_thr (float): The threshold for text center region
          probability map.
      center_region_area_thr (int): The threshold for filtering small-sized
          text center region.
code: def __init__(
      self,
      k_at_hops: Tuple[int, int],
      num_adjacent_linkages: int,
      node_geo_feat_len: int,
      pooling_scale: float,
      pooling_output_size: Sequence[int],
      nms_thr: float,
      min_width: float,
      max_width: float,
      comp_shrink_ratio: float,
      comp_w_h_ratio: float,
      comp_score_thr: float,
      text_region_thr: float,
      center_region_thr: float,
      center_region_area_thr: int,
  ) -> None:
      assert len(k_at_hops) == 2
      assert isinstance(k_at_hops, tuple)
      assert isinstance(num_adjacent_linkages, int)
      assert isinstance(node_geo_feat_len, int)
      assert isinstance(pooling_scale, float)
      assert isinstance(pooling_output_size, tuple)
      assert isinstance(nms_thr, float)
      assert isinstance(min_width, float)
      assert isinstance(max_width, float)
      assert isinstance(comp_shrink_ratio, float)
      assert isinstance(comp_w_h_ratio, float)
      assert isinstance(comp_score_thr, float)
      assert isinstance(text_region_thr, float)
      assert isinstance(center_region_thr, float)
      assert isinstance(center_region_area_thr, int)
  
      self.k_at_hops = k_at_hops
      self.active_connection = num_adjacent_linkages
      self.local_graph_depth = len(self.k_at_hops)
      self.node_geo_feat_dim = node_geo_feat_len
      self.pooling = RoIAlignRotated(pooling_output_size, pooling_scale)
      self.nms_thr = nms_thr
      self.min_width = min_width
      self.max_width = max_width
      self.comp_shrink_ratio = comp_shrink_ratio
      self.comp_w_h_ratio = comp_w_h_ratio
      self.comp_score_thr = comp_score_thr
      self.text_region_thr = text_region_thr
      self.center_region_thr = center_region_thr
      self.center_region_area_thr = center_region_area_thr
  
imports: from typing import Dict, List, Optional, Sequence, Tuple, Union
  import cv2
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.ops import RoIAlignRotated
  from mmengine.model import BaseModule
  from numpy import ndarray
  from torch import Tensor
  from torch.nn import init
  from mmocr.models.textdet.heads import BaseTextDetHead
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import fill_hole
label_desc: Use image node_id 1 to create a new ProposalLocalGraphs object  with example: obj = ProposalLocalGraphs(k_at_hops, num_adjacent_linkages, node_geo_feat_len, pooling_scale, pooling_output_size, nms_thr, min_width, max_width, comp_shrink_ratio, comp_w_h_ratio, comp_score_thr, text_region_thr, center_region_thr, center_region_area_thr)