code: def filter_invalid(bbox, label=None, score=None, thr=0.0, min_size=0):
      if score.numel() > 0:
          soft_score = score.max(-1)
          valid = soft_score >= thr
          bbox = bbox[valid]
  
          if label is not None:
              label = label[valid]
          score = score[valid]
      if min_size is not None and bbox.shape[0] > 0:
          bw = bbox[:, 2]
          bh = bbox[:, 3]
          valid = (bw > min_size) & (bh > min_size)
          bbox = bbox[valid]
  
          if label is not None:
              label = label[valid]
              score = score[valid]
  
      return bbox, label, score
  
imports: import paddle
  import paddle.nn.functional
label_desc: Use image node_id 3 for calling a global function with example usage: filter_invalid(bbox, label, score, thr, min_size) and returns: bbox,  label,  score