code: def generate_pivot_list_fast(
      p_score,
      p_char_maps,
      f_direction,
      Lexicon_Table,
      score_thresh=0.5,
      point_gather_mode=None,
  ):
      """
      return center point and end point of TCL instance; filter with the char maps;
      """
      p_score = p_score[0]
      f_direction = f_direction.transpose(1, 2, 0)
      p_tcl_map = (p_score > score_thresh) * 1.0
      skeleton_map = thin(p_tcl_map.astype(np.uint8))
      instance_count, instance_label_map = cv2.connectedComponents(
          skeleton_map.astype(np.uint8), connectivity=8
      )
  
      # get TCL Instance
      all_pos_yxs = []
      if instance_count > 0:
          for instance_id in range(1, instance_count):
              pos_list = []
              ys, xs = np.where(instance_label_map == instance_id)
              pos_list = list(zip(ys, xs))
  
              if len(pos_list) < 3:
                  continue
  
              pos_list_sorted = sort_and_expand_with_direction_v2(
                  pos_list, f_direction, p_tcl_map
              )
              all_pos_yxs.append(pos_list_sorted)
  
      p_char_maps = p_char_maps.transpose([1, 2, 0])
      decoded_str, keep_yxs_list = ctc_decoder_for_image(
          all_pos_yxs,
          logits_map=p_char_maps,
          Lexicon_Table=Lexicon_Table,
          point_gather_mode=point_gather_mode,
      )
      return keep_yxs_list, decoded_str
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import cv2
  import math
  import numpy
  from itertools import groupby
  from skimage.morphology._skeletonize import thin
label_desc: Use image node_id 17 for calling a global function with example usage: generate_pivot_list_fast(p_score, p_char_maps, f_direction, Lexicon_Table, score_thresh, point_gather_mode) and returns: keep_yxs_list,  decoded_str