code: def culane_metric(
      pred,
      anno,
      width=30,
      iou_thresholds=[0.5],
      official=True,
      img_shape=(590, 1640, 3),
  ):
      _metric = {}
      for thr in iou_thresholds:
          tp = 0
          fp = 0 if len(anno) != 0 else len(pred)
          fn = 0 if len(pred) != 0 else len(anno)
          _metric[thr] = [tp, fp, fn]
  
      interp_pred = np.array(
          [interp(pred_lane, n=5) for pred_lane in pred], dtype=object
      )  # (4, 50, 2)
      interp_anno = np.array(
          [interp(anno_lane, n=5) for anno_lane in anno], dtype=object
      )  # (4, 50, 2)
  
      if official:
          ious = discrete_cross_iou(
              interp_pred, interp_anno, width=width, img_shape=img_shape
          )
      else:
          ious = continuous_cross_iou(
              interp_pred, interp_anno, width=width, img_shape=img_shape
          )
  
      row_ind, col_ind = linear_sum_assignment(1 - ious)
  
      _metric = {}
      for thr in iou_thresholds:
          tp = int((ious[row_ind, col_ind] > thr).sum())
          fp = len(pred) - tp
          fn = len(anno) - tp
          _metric[thr] = [tp, fp, fn]
      return _metric
  
imports: import os
  import cv2
  import numpy
  import os.path
  from functools import partial
  from .metrics import Metric
  from scipy.interpolate import splprep, splev
  from scipy.optimize import linear_sum_assignment
  from shapely.geometry import LineString, Polygon
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 5 for calling a global function with example usage: culane_metric(pred, anno, width, iou_thresholds, official, img_shape) and returns: _metric