class_docstr: Merge text components and construct boundaries of text instances.
  
  Args:
      link_thr (float): The edge score threshold. Defaults to 0.8.
      edge_len_thr (int or float): The edge length threshold. Defaults to 50.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          [polygons'].
docstr: Add corner points to predicted side lines. This code was partially
  adapted from https://github.com/GXYM/DRRG licensed under the MIT
  license.
  
  Args:
      top_line (List[list[int]]): The predicted top sidelines of text
          instance.
      btm_line (List[list[int]]): The predicted bottom sidelines of text
          instance.
      start_box (ndarray): The first text component box.
      end_box (ndarray): The last text component box.
  
  Returns:
      tuple(top_line, bot_line):
  
      - top_line (List[list[int]]): The top sidelines with corner point
        added.
      - bot_line (List[list[int]]): The bottom sidelines with corner
        point added.
docstr_tok: ["Add","corner","points","to","predicted","side","lines",".","This","code","was","partially","adapted","from","https",":","\/\/github.com\/GXYM\/DRRG","licensed","under","the","MIT","license",".","Args",":","top_line","(","List","[","list","[","int","]","]",")",":","The","predicted","top","sidelines","of","text","instance",".","btm_line","(","List","[","list","[","int","]","]",")",":","The","predicted","bottom","sidelines","of","text","instance",".","start_box","(","ndarray",")",":","The","first","text","component","box",".","end_box","(","ndarray",")",":","The","last","text","component","box",".","Returns",":","tuple","(","top_line",",","bot_line",")",":","-","top_line","(","List","[","list","[","int","]","]",")",":","The","top","sidelines","with","corner","point","added",".","-","bot_line","(","List","[","list","[","int","]","]",")",":","The","bottom","sidelines","with","corner","point","added","."]
code: def _fix_corner(
      self,
      top_line: List[List[int]],
      btm_line: List[List[int]],
      start_box: ndarray,
      end_box: ndarray,
  ) -> Tuple[List[List[int]], List[List[int]]]:
      """Add corner points to predicted side lines. This code was partially
      adapted from https://github.com/GXYM/DRRG licensed under the MIT
      license.
  
      Args:
          top_line (List[list[int]]): The predicted top sidelines of text
              instance.
          btm_line (List[list[int]]): The predicted bottom sidelines of text
              instance.
          start_box (ndarray): The first text component box.
          end_box (ndarray): The last text component box.
  
      Returns:
          tuple(top_line, bot_line):
  
          - top_line (List[list[int]]): The top sidelines with corner point
            added.
          - bot_line (List[list[int]]): The bottom sidelines with corner
            point added.
      """
      assert isinstance(top_line, list)
      assert all(isinstance(point, list) for point in top_line)
      assert isinstance(btm_line, list)
      assert all(isinstance(point, list) for point in btm_line)
      assert start_box.shape == end_box.shape == (4, 2)
  
      contour = np.array(top_line + btm_line[::-1])
      start_left_mid = (start_box[0] + start_box[3]) / 2
      start_right_mid = (start_box[1] + start_box[2]) / 2
      end_left_mid = (end_box[0] + end_box[3]) / 2
      end_right_mid = (end_box[1] + end_box[2]) / 2
      if not self._in_contour(contour, start_left_mid):
          top_line.insert(0, start_box[0].tolist())
          btm_line.insert(0, start_box[3].tolist())
      elif not self._in_contour(contour, start_right_mid):
          top_line.insert(0, start_box[1].tolist())
          btm_line.insert(0, start_box[2].tolist())
      if not self._in_contour(contour, end_left_mid):
          top_line.append(end_box[0].tolist())
          btm_line.append(end_box[3].tolist())
      elif not self._in_contour(contour, end_right_mid):
          top_line.append(end_box[1].tolist())
          btm_line.append(end_box[2].tolist())
      return top_line, btm_line
  
imports: import functools
  import operator
  from typing import Dict, List, Tuple, Union
  import cv2
  import numpy
  import torch
  from mmengine.structures import InstanceData
  from numpy import ndarray
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 12 for calling the DRRGPostprocessor obj's underlying member method code with example usage: obj._fix_corner(top_line, btm_line, start_box, end_box) and returns: top_line,  btm_line