class_docstr: Generate local graphs for GCN to classify the neighbors of a pivot for
  `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.
      local_graph_thr(float): The threshold for filtering out identical local
          graphs.
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],
      local_graph_thr: float,
  ) -> None:
      assert len(k_at_hops) == 2
      assert all(isinstance(n, int) for n in k_at_hops)
      assert isinstance(num_adjacent_linkages, int)
      assert isinstance(node_geo_feat_len, int)
      assert isinstance(pooling_scale, float)
      assert all(isinstance(n, int) for n in pooling_output_size)
      assert isinstance(local_graph_thr, float)
  
      self.k_at_hops = k_at_hops
      self.num_adjacent_linkages = num_adjacent_linkages
      self.node_geo_feat_dim = node_geo_feat_len
      self.pooling = RoIAlignRotated(pooling_output_size, pooling_scale)
      self.local_graph_thr = local_graph_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 LocalGraphs object  with example: obj = LocalGraphs(k_at_hops, num_adjacent_linkages, node_geo_feat_len, pooling_scale, pooling_output_size, local_graph_thr)