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: The output of the neural network is a tensor of shape (b, 896, 16)
  containing the bounding box regressor predictions, as well as a tensor
  of shape (b, 896, 1) with the classification confidences.
  
  This function converts these two "raw" tensors into proper detections.
  Returns a list of (num_detections, 17) tensors, one for each image in
  the batch.
  
  This is based on the source code from:
  mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.cc
  mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.proto
docstr_tok: ["The","output","of","the","neural","network","is","a","tensor","of","shape","(","b",",","896",",","16",")","containing","the","bounding","box","regressor","predictions",",","as","well","as","a","tensor","of","shape","(","b",",","896",",","1",")","with","the","classification","confidences",".","This","function","converts","these","two","``","raw","''","tensors","into","proper","detections",".","Returns","a","list","of","(","num_detections",",","17",")","tensors",",","one","for","each","image","in","the","batch",".","This","is","based","on","the","source","code","from",":","mediapipe\/calculators\/tflite\/tflite_tensors_to_detections_calculator.cc","mediapipe\/calculators\/tflite\/tflite_tensors_to_detections_calculator.proto"]
code: def _tensors_to_detections(
      self, raw_box_tensor, raw_score_tensor, anchors
  ):
      """The output of the neural network is a tensor of shape (b, 896, 16)
      containing the bounding box regressor predictions, as well as a tensor
      of shape (b, 896, 1) with the classification confidences.
  
      This function converts these two "raw" tensors into proper detections.
      Returns a list of (num_detections, 17) tensors, one for each image in
      the batch.
  
      This is based on the source code from:
      mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.cc
      mediapipe/calculators/tflite/tflite_tensors_to_detections_calculator.proto
      """
      assert raw_box_tensor.ndimension() == 3
      assert raw_box_tensor.shape[1] == self.num_anchors
      assert raw_box_tensor.shape[2] == self.num_coords
  
      assert raw_score_tensor.ndimension() == 3
      assert raw_score_tensor.shape[1] == self.num_anchors
      assert raw_score_tensor.shape[2] == self.num_classes
  
      assert raw_box_tensor.shape[0] == raw_score_tensor.shape[0]
  
      detection_boxes = self._decode_boxes(raw_box_tensor, anchors)
  
      thresh = self.score_clipping_thresh
      raw_score_tensor = raw_score_tensor.clamp(-thresh, thresh)
      detection_scores = raw_score_tensor.sigmoid().squeeze(dim=-1)
  
      # Note: we stripped off the last dimension from the scores tensor
      # because there is only has one class. Now we can simply use a mask
      # to filter out the boxes with too low confidence.
      mask = detection_scores >= self.min_score_thresh
  
      # Because each image from the batch can have a different number of
      # detections, process them one at a time using a loop.
      output_detections = []
      for i in range(raw_box_tensor.shape[0]):
          boxes = detection_boxes[i, mask[i]]
          scores = detection_scores[i, mask[i]].unsqueeze(dim=-1)
          output_detections.append(
              torch.cat((boxes, scores), dim=-1).to("cpu")
          )
  
      return output_detections
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 13 for calling the BlazeFace obj's underlying member method code with example usage: obj._tensors_to_detections(raw_box_tensor, raw_score_tensor, anchors) and returns: output_detections