code: def generateBoundingBox(reg, probs, scale, thresh):
      stride = 2
      cellsize = 12
  
      reg = reg.permute(1, 0, 2, 3)
  
      mask = probs >= thresh
      mask_inds = mask.nonzero()
      image_inds = mask_inds[:, 0]
      score = probs[mask]
      reg = reg[:, mask].permute(1, 0)
      bb = mask_inds[:, 1:].type(reg.dtype).flip(1)
      q1 = ((stride * bb + 1) / scale).floor()
      q2 = ((stride * bb + cellsize - 1 + 1) / scale).floor()
      boundingbox = torch.cat([q1, q2, score.unsqueeze(1), reg], dim=1)
      return boundingbox, image_inds
  
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 4 for calling a global function with example usage: generateBoundingBox(reg, probs, scale, thresh) and returns: boundingbox,  image_inds