code: def dump_data_to_json(
      self,
      output,
      im_path,
      run_time=0,
      is_dump_json=True,
      is_view=False,
  ):
      seg_pred = output[0]
      seg_pred = nn.functional.softmax(seg_pred, axis=1)
      seg_pred = seg_pred.numpy()
      lane_coords_list = self.laneProcessor.get_lane_coords(seg_pred)
  
      for batch in range(len(seg_pred)):
          lane_coords = lane_coords_list[batch]
          path_list = im_path[batch].split("/")
          if is_dump_json:
              json_pred = {}
              json_pred["lanes"] = []
              json_pred["run_time"] = run_time * 1000
              json_pred["h_sample"] = []
  
              json_pred["raw_file"] = os.path.join(*path_list[-4:])
              for l in lane_coords:
                  if len(l) == 0:
                      continue
                  json_pred["lanes"].append([])
                  for x, y in l:
                      json_pred["lanes"][-1].append(int(x))
              for x, y in lane_coords[0]:
                  json_pred["h_sample"].append(y)
              self.dump_to_json.append(json.dumps(json_pred))
  
          if is_view:
              img = cv2.imread(im_path[batch])
              if is_dump_json:
                  img_name = "_".join([x for x in path_list[-4:]])
                  sub_dir = "visual_eval"
              else:
                  img_name = os.path.basename(im_path[batch])
                  sub_dir = "visual_points"
              saved_path = os.path.join(
                  self.save_dir, sub_dir, img_name
              )
              self.draw(img, lane_coords, saved_path)
  
file_path: PaddleHub/modules/image/semantic_segmentation/bisenet_lane_segmentation/lane_processor/tusimple_processor.py
imports: import os
  import cv2
  import json
  import paddle.nn
  from .lane import LaneEval
  from .get_lane_coords import LaneProcessor
label_desc: Use image node_id 2 for calling the TusimpleProcessor obj's underlying member method code with example usage: obj.dump_data_to_json(output, im_path, run_time, is_dump_json, is_view) without return types