class_docstr: The BlazeFace face detection model from MediaPipe.
  
  The version from MediaPipe is simpler than the one in the paper;
  it does not use the "double" BlazeBlocks.
  
  Because we won't be training this model, it doesn't need to have
  batchnorm layers. These have already been "folded" into the conv
  weights by TFLite.
  
  The conversion to PyTorch is fairly straightforward, but there are
  some small differences between TFLite and PyTorch in how they handle
  padding on conv layers with stride 2.
  
  This version works on batches, while the MediaPipe version can only
  handle a single image at a time.
  
  Based on code from https://github.com/tkat0/PyTorch_BlazeFace/ and
  https://github.com/google/mediapipe/
docstr: Makes a prediction on a batch of images.
  
  Arguments:
      x: a NumPy array of shape (b, H, W, 3) or a PyTorch tensor of
         shape (b, 3, H, W). The height and width should be 128 pixels.
  
  Returns:
      A list containing a tensor of face detections for each image in
      the batch. If no faces are found for an image, returns a tensor
      of shape (0, 17).
  
  Each face detection is a PyTorch tensor consisting of 17 numbers:
      - ymin, xmin, ymax, xmax
      - x,y-coordinates for the 6 keypoints
      - confidence score
docstr_tok: ["Makes","a","prediction","on","a","batch","of","images",".","Arguments",":","x",":","a","NumPy","array","of","shape","(","b",",","H",",","W",",","3",")","or","a","PyTorch","tensor","of","shape","(","b",",","3",",","H",",","W",")",".","The","height","and","width","should","be","128","pixels",".","Returns",":","A","list","containing","a","tensor","of","face","detections","for","each","image","in","the","batch",".","If","no","faces","are","found","for","an","image",",","returns","a","tensor","of","shape","(","0",",","17",")",".","Each","face","detection","is","a","PyTorch","tensor","consisting","of","17","numbers",":","-","ymin",",","xmin",",","ymax",",","xmax","-","x",",","y-coordinates","for","the","6","keypoints","-","confidence","score"]
code: def predict_on_batch(self, x):
      """Makes a prediction on a batch of images.
  
      Arguments:
          x: a NumPy array of shape (b, H, W, 3) or a PyTorch tensor of
             shape (b, 3, H, W). The height and width should be 128 pixels.
  
      Returns:
          A list containing a tensor of face detections for each image in
          the batch. If no faces are found for an image, returns a tensor
          of shape (0, 17).
  
      Each face detection is a PyTorch tensor consisting of 17 numbers:
          - ymin, xmin, ymax, xmax
          - x,y-coordinates for the 6 keypoints
          - confidence score
      """
      if isinstance(x, np.ndarray):
          x = torch.from_numpy(x).permute((0, 3, 1, 2))
  
      assert x.shape[1] == 3
      if self.back_model:
          assert x.shape[2] == 256
          assert x.shape[3] == 256
      else:
          assert x.shape[2] == 128
          assert x.shape[3] == 128
  
      # 1. Preprocess the images into tensors:
      x = x.to(self._device())
      x = self._preprocess(x)
  
      # 2. Run the neural network:
      with torch.inference_mode():
          out = self.__call__(x)
  
      # 3. Postprocess the raw predictions:
      detections = self._tensors_to_detections(
          out[0], out[1], self.anchors
      )
  
      # 4. Non-maximum suppression to remove overlapping detections:
      filtered_detections = []
      for i in range(len(detections)):
          faces = self._weighted_non_max_suppression(detections[i])
          faces = (
              torch.stack(faces)
              if len(faces) > 0
              else torch.zeros((0, 17))
          )
          filtered_detections.append(faces)
  
      return filtered_detections
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 12 for calling the BlazeFace obj's underlying member method code with example usage: obj.predict_on_batch(x) and returns: filtered_detections