code: def detect(net, img, target_size=128, device="cuda"):
      H, W, C = img.shape
      orig_size = min(H, W)
      img, (xshift, yshift) = resize_and_crop_image(img, target_size)
      preds = net.predict_on_image(img)
  
      if 0 == len(preds):
          return [[]]
  
      shift = np.array([xshift, yshift] * 2)
      scores = preds[:, -1:]
  
      # TODO: ugly
      # reverses, x and y to adapt with face-alignment code
      locs = np.concatenate(
          (preds[:, 1:2], preds[:, 0:1], preds[:, 3:4], preds[:, 2:3]),
          axis=1,
      )
      return [
          np.concatenate((locs * orig_size + shift, scores), axis=1)
      ]
  
file_path: face-alignment/face_alignment/detection/blazeface/detect.py
imports: import torch
  import torch.nn.functional
  import cv2
  import numpy
  from .utils import *
label_desc: Use image node_id 1 for calling a global function with example usage: detect(net, img, target_size, device) and returns: list, list