class_docstr: Wrapper around Detectron2 to return the required predicted bounding boxes
  as a ndarray.
class_docstr_tok: ["Wrapper","around","Detectron2","to","return","the","required","predicted","bounding","boxes","as","a","ndarray","."]
docstr: Return bounding boxes predictions as a tensor.
  Args:
      task (TaskInfo object): task object that contain
          the necessary information for action prediction. (e.g. frames)
  Returns:
      task (TaskInfo object): the same task info object but filled with
          prediction values (a tensor) and the corresponding boxes for
          action detection task.
docstr_tok: ["Return","bounding","boxes","predictions","as","a","tensor",".","Args",":","task","(","TaskInfo","object",")",":","task","object","that","contain","the","necessary","information","for","action","prediction",".","(","e.g",".","frames",")","Returns",":","task","(","TaskInfo","object",")",":","the","same","task","info","object","but","filled","with","prediction","values","(","a","tensor",")","and","the","corresponding","boxes","for","action","detection","task","."]
code: def __call__(self, task):
      """
      Return bounding boxes predictions as a tensor.
      Args:
          task (TaskInfo object): task object that contain
              the necessary information for action prediction. (e.g. frames)
      Returns:
          task (TaskInfo object): the same task info object but filled with
              prediction values (a tensor) and the corresponding boxes for
              action detection task.
      """
      middle_frame = task.frames[len(task.frames) // 2]
      outputs = self.predictor(middle_frame)
      # Get only human instances
      mask = outputs["instances"].pred_classes == 0
      pred_boxes = outputs["instances"].pred_boxes.tensor[mask]
      task.add_bboxes(pred_boxes)
  
      return task
  
imports: import queue
  import cv2
  import torch
  from detectron2 import model_zoo
  from detectron2.config import get_cfg
  from detectron2.engine import DefaultPredictor
  import slowfast.utils.checkpoint
  from slowfast.datasets import cv2_transform
  from slowfast.models import build_model
  from slowfast.utils import logging
  from slowfast.visualization.utils import process_cv2_inputs
label_desc: Use image node_id 2 for calling the Detectron2Predictor obj's underlying member method code with example usage: obj.__call__(task) and returns: task