class_docstr: Args:
      input_shape (int): network input image size
      ori_shape (int): ori image shape of before padding
      scale_factor (float): scale factor of ori image
      enable_mkldnn (bool): whether to open MKLDNN
class_docstr_tok: ["Args",":","input_shape","(","int",")",":","network","input","image","size","ori_shape","(","int",")",":","ori","image","shape","of","before","padding","scale_factor","(","float",")",":","scale","factor","of","ori","image","enable_mkldnn","(","bool",")",":","whether","to","open","MKLDNN"]
docstr: Convert predictions to internal Lane structure for evaluation.
docstr_tok: ["Convert","predictions","to","internal","Lane","structure","for","evaluation","."]
code: def predictions_to_pred(self, predictions):
      """
      Convert predictions to internal Lane structure for evaluation.
      """
      lanes = []
      for lane in predictions:
          lane_xs = lane[6:].clone()
          start = min(
              max(0, int(round(lane[2].item() * self.n_strips))),
              self.n_strips,
          )
          length = int(round(lane[5].item()))
          end = start + length - 1
          end = min(end, len(self.prior_ys) - 1)
          if start > 0:
              mask = (
                  ((lane_xs[:start] >= 0.0) & (lane_xs[:start] <= 1.0))
                  .cpu()
                  .detach()
                  .numpy()[::-1]
              )
              mask = ~((mask.cumprod()[::-1]).astype(np.bool))
              lane_xs[:start][mask] = -2
          if end < len(self.prior_ys) - 1:
              lane_xs[end + 1 :] = -2
  
          lane_ys = self.prior_ys[lane_xs >= 0].clone()
          lane_xs = lane_xs[lane_xs >= 0]
          lane_xs = lane_xs.flip(axis=0).astype("float64")
          lane_ys = lane_ys.flip(axis=0)
  
          lane_ys = (
              lane_ys * (self.ori_img_h - self.cut_height)
              + self.cut_height
          ) / self.ori_img_h
          if len(lane_xs) <= 1:
              continue
          points = paddle.stack(
              x=(lane_xs.reshape([-1, 1]), lane_ys.reshape([-1, 1])),
              axis=1,
          ).squeeze(axis=2)
          lane = Lane(
              points=points.cpu().numpy(),
              metadata={
                  "start_x": lane[3],
                  "start_y": lane[2],
                  "conf": lane[1],
              },
          )
          lanes.append(lane)
      return lanes
  
imports: import numpy
  import paddle
  import paddle.nn
  from scipy.special import softmax
  from scipy.interpolate import InterpolatedUnivariateSpline
label_desc: Use image node_id 2 for calling the CLRNetPostProcess obj's underlying member method code with example usage: obj.predictions_to_pred(predictions) and returns: lanes