class_docstr: A predictor that runs the model asynchronously, possibly on >1 GPUs.
  Because rendering the visualization takes considerably amount of time,
  this helps improve throughput when rendering videos.
class_docstr_tok: ["A","predictor","that","runs","the","model","asynchronously",",","possibly","on",">","1","GPUs",".","Because","rendering","the","visualization","takes","considerably","amount","of","time",",","this","helps","improve","throughput","when","rendering","videos","."]
code: def get(self):
      self.get_idx += 1  # the index needed for this request
      if len(self.result_rank) and self.result_rank[0] == self.get_idx:
          res = self.result_data[0]
          del self.result_data[0], self.result_rank[0]
          return res
  
      while True:
          # make sure the results are returned in the correct order
          idx, res = self.result_queue.get()
          if idx == self.get_idx:
              return res
          insert = bisect.bisect(self.result_rank, idx)
          self.result_rank.insert(insert, idx)
          self.result_data.insert(insert, res)
  
imports: import atexit
  import bisect
  import multiprocessing
  from collections import deque
  import cv2
  import torch
  from detectron2.data import MetadataCatalog
  from detectron2.engine.defaults import DefaultPredictor
  from detectron2.utils.video_visualizer import VideoVisualizer
  from detectron2.utils.visualizer import ColorMode, Visualizer
label_desc: Use image node_id 3 for calling the AsyncPredictor obj's underlying member method code with example usage: obj.get() and returns: res, res