code: def postprcess(out):
      numClasses = 20
      anchors = [
          1.08,
          1.19,
          3.42,
          4.41,
          6.63,
          11.38,
          9.42,
          5.11,
          16.62,
          10.52,
      ]
  
      def sigmoid(x, derivative=False):
          return x * (1 - x) if derivative else 1 / (1 + np.exp(-x))
  
      def softmax(x):
          scoreMatExp = np.exp(np.asarray(x))
          return scoreMatExp / scoreMatExp.sum(0)
  
      clut = [
          (0, 0, 0),
          (255, 0, 0),
          (255, 0, 255),
          (0, 0, 255),
          (0, 255, 0),
          (0, 255, 128),
          (128, 255, 0),
          (128, 128, 0),
          (0, 128, 255),
          (128, 0, 128),
          (255, 0, 128),
          (128, 0, 255),
          (255, 128, 128),
          (128, 255, 128),
          (255, 255, 0),
          (255, 128, 128),
          (128, 128, 255),
          (255, 128, 128),
          (128, 255, 128),
      ]
      label = [
          "aeroplane",
          "bicycle",
          "bird",
          "boat",
          "bottle",
          "bus",
          "car",
          "cat",
          "chair",
          "cow",
          "diningtable",
          "dog",
          "horse",
          "motorbike",
          "person",
          "pottedplant",
          "sheep",
          "sofa",
          "train",
          "tvmonitor",
      ]
  
      img = get_image()
      draw = ImageDraw.Draw(img)
  
      for cy in range(13):
          for cx in range(13):
              for b in range(5):
                  channel = b * (numClasses + 5)
                  tx = out[channel][cy][cx]
                  ty = out[channel + 1][cy][cx]
                  tw = out[channel + 2][cy][cx]
                  th = out[channel + 3][cy][cx]
                  tc = out[channel + 4][cy][cx]
                  x = (float(cx) + sigmoid(tx)) * 32
                  y = (float(cy) + sigmoid(ty)) * 32
  
                  w = np.exp(tw) * 32 * anchors[2 * b]
                  h = np.exp(th) * 32 * anchors[2 * b + 1]
  
                  confidence = sigmoid(tc)
  
                  classes = np.zeros(numClasses)
                  for c in range(0, numClasses):
                      classes[c] = out[channel + 5 + c][cy][cx]
  
                  classes = softmax(classes)
                  detectedClass = classes.argmax()
                  if 0.5 < classes[detectedClass] * confidence:
                      color = clut[detectedClass]
                      x = x - w / 2
                      y = y - h / 2
                      draw.line((x, y, x + w, y), fill=color)
                      draw.line((x, y, x, y + h), fill=color)
                      draw.line((x + w, y, x + w, y + h), fill=color)
                      draw.line((x, y + h, x + w, y + h), fill=color)
                      draw.text(
                          (x, y), label[detectedClass], fill=color
                      )
                      logging.info(
                          "bounding box: (%.2f, %.2f, %.2f, %.2f)"
                          % (x, y, x + w, y + h)
                      )
                      logging.info(
                          "class=%s ; probability=%f"
                          % (
                              label[detectedClass],
                              classes[detectedClass] * confidence,
                          )
                      )
      img.save("result.png")
  
file_path: singa/examples/onnx/tiny_yolov2.py
imports: import os
  import numpy
  from PIL import Image, ImageDraw
  from singa import device
  from singa import tensor
  from singa import sonnx
  import onnx
  from utils import download_model, check_exist_or_download
  import logging
label_desc: Use image node_id 3 for calling a global function with example usage: postprcess(out) and returns: unknown, unknown