code: def batched_nms_numpy(boxes, scores, idxs, threshold, method):
      device = boxes.device
      if boxes.numel() == 0:
          return torch.empty((0,), dtype=torch.int64, device=device)
      # strategy: in order to perform NMS independently per class.
      # we add an offset to all the boxes. The offset is dependent
      # only on the class idx, and is large enough so that boxes
      # from different classes do not overlap
      max_coordinate = boxes.max()
      offsets = idxs.to(boxes) * (max_coordinate + 1)
      boxes_for_nms = boxes + offsets[:, None]
      boxes_for_nms = boxes_for_nms.cpu().numpy()
      scores = scores.cpu().numpy()
      keep = nms_numpy(boxes_for_nms, scores, threshold, method)
      return torch.as_tensor(keep, dtype=torch.long, device=device)
  
imports: import torch
  from torch.nn.functional import interpolate
  from torchvision.transforms import functional
  from torchvision.ops.boxes import batched_nms
  from PIL import Image
  import numpy
  import os
  import math
label_desc: Use image node_id 6 for calling a global function with example usage: batched_nms_numpy(boxes, scores, idxs, threshold, method) and returns: torch, torch