docstr: Convert model output to lanes.
docstr_tok: ["Convert","model","output","to","lanes","."]
code: def get_lanes(self, output, as_lanes=True):
      """
      Convert model output to lanes.
      """
      softmax = nn.Softmax(axis=1)
      decoded = []
  
      for predictions in output:
          threshold = self.conf_threshold
          scores = softmax(predictions[:, :2])[:, 1]
          keep_inds = scores >= threshold
          predictions = predictions[keep_inds]
          scores = scores[keep_inds]
  
          if predictions.shape[0] == 0:
              decoded.append([])
              continue
          nms_predictions = predictions.detach().clone()
          nms_predictions = paddle.concat(
              x=[nms_predictions[..., :4], nms_predictions[..., 5:]],
              axis=-1,
          )
  
          nms_predictions[..., 4] = (
              nms_predictions[..., 4] * self.n_strips
          )
          nms_predictions[..., 5:] = nms_predictions[..., 5:] * (
              self.img_w - 1
          )
  
          keep = self.lane_nms(
              nms_predictions[..., 5:],
              scores,
              nms_overlap_thresh=self.nms_thres,
              top_k=self.max_lanes,
          )
  
          predictions = predictions.index_select(keep)
  
          if predictions.shape[0] == 0:
              decoded.append([])
              continue
          predictions[:, 5] = paddle.round(
              predictions[:, 5] * self.n_strips
          )
          if as_lanes:
              pred = self.predictions_to_pred(predictions)
          else:
              pred = predictions
          decoded.append(pred)
      return decoded
  
imports: import math
  import paddle
  import numpy
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ppdet.modeling.initializer import normal_
  from ppdet.modeling.lane_utils import Lane
  from ppdet.modeling.losses import line_iou
  from ppdet.modeling.clrnet_utils import ROIGather, LinearModule, SegDecoder
label_desc: Use image node_id 9 for calling the CLRHead obj's underlying member method code with example usage: obj.get_lanes(output, as_lanes) and returns: decoded