code: def rescore(overlap, scores, thresh, type="gaussian"):
      assert overlap.shape[0] == scores.shape[0]
      if type == "linear":
          inds = np.where(overlap >= thresh)[0]
          scores[inds] = scores[inds] * (1 - overlap[inds])
      else:
          scores = scores * np.exp(-(overlap**2) / thresh)
  
      return scores
  
imports: import cv2
  import numpy
  import paddle.nn.functional
label_desc: Use image node_id 12 for calling a global function with example usage: rescore(overlap, scores, thresh, type) and returns: scores