class_docstr: The class for implementing TextSnake loss. This is partially adapted
  from https://github.com/princewang1994/TextSnake.pytorch.
  
  TextSnake: `A Flexible Representation for Detecting Text of Arbitrary
  Shapes <https://arxiv.org/abs/1807.01544>`_.
  
  Args:
      ohem_ratio (float): The negative/positive ratio in ohem.
      downsample_ratio (float): Downsample ratio. Defaults to 1.0. TODO:
          remove it.
      orientation_thr (float): The threshold for distinguishing between
          head edge and tail edge among the horizontal and vertical edges
          of a quadrangle.
      resample_step (float): The step of resampling.
      center_region_shrink_ratio (float): The shrink ratio of text center.
      loss_text (dict): The loss config used to calculate the text loss.
      loss_center (dict): The loss config used to calculate the center loss.
      loss_radius (dict): The loss config used to calculate the radius loss.
      loss_sin (dict): The loss config used to calculate the sin loss.
      loss_cos (dict): The loss config used to calculate the cos loss.
docstr: Resample two sidelines to be of the same points number according to
  step size.
  
  Args:
      sideline1 (ndarray): The points composing a sideline of a text
          polygon.
      sideline2 (ndarray): The points composing another sideline of a
          text polygon.
      resample_step (float): The resampled step size.
  
  Returns:
      Tuple(resampled_line1, resampled_line2):
  
      - resampled_line1 (ndarray): The resampled line 1.
      - resampled_line2 (ndarray): The resampled line 2.
docstr_tok: ["Resample","two","sidelines","to","be","of","the","same","points","number","according","to","step","size",".","Args",":","sideline1","(","ndarray",")",":","The","points","composing","a","sideline","of","a","text","polygon",".","sideline2","(","ndarray",")",":","The","points","composing","another","sideline","of","a","text","polygon",".","resample_step","(","float",")",":","The","resampled","step","size",".","Returns",":","Tuple","(","resampled_line1",",","resampled_line2",")",":","-","resampled_line1","(","ndarray",")",":","The","resampled","line","1",".","-","resampled_line2","(","ndarray",")",":","The","resampled","line","2","."]
code: def _resample_sidelines(
      self, sideline1: ndarray, sideline2: ndarray, resample_step: float
  ) -> Tuple[ndarray, ndarray]:
      """Resample two sidelines to be of the same points number according to
      step size.
  
      Args:
          sideline1 (ndarray): The points composing a sideline of a text
              polygon.
          sideline2 (ndarray): The points composing another sideline of a
              text polygon.
          resample_step (float): The resampled step size.
  
      Returns:
          Tuple(resampled_line1, resampled_line2):
  
          - resampled_line1 (ndarray): The resampled line 1.
          - resampled_line2 (ndarray): The resampled line 2.
      """
  
      assert sideline1.ndim == sideline2.ndim == 2
      assert sideline1.shape[1] == sideline2.shape[1] == 2
      assert sideline1.shape[0] >= 2
      assert sideline2.shape[0] >= 2
      assert isinstance(resample_step, float)
  
      _, length1 = self._cal_curve_length(sideline1)
      _, length2 = self._cal_curve_length(sideline2)
  
      avg_length = (length1 + length2) / 2
      resample_point_num = max(
          int(float(avg_length) / resample_step) + 1, 3
      )
  
      resampled_line1 = self._resample_line(
          sideline1, resample_point_num
      )
      resampled_line2 = self._resample_line(
          sideline2, resample_point_num
      )
  
      return resampled_line1, resampled_line2
  
imports: from typing import Dict, List, Sequence, Tuple
  import cv2
  import numpy
  import torch
  from mmcv.image import impad, imrescale
  from mmdet.models.utils import multi_apply
  from numpy import ndarray
  from numpy.linalg import norm
  from torch import Tensor
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .seg_based_module_loss import SegBasedModuleLoss
label_desc: Use image node_id 11 for calling the TextSnakeModuleLoss obj's underlying member method code with example usage: obj._resample_sidelines(sideline1, sideline2, resample_step) and returns: resampled_line1,  resampled_line2