class_docstr: Synchronous Action Prediction and Visualization pipeline with AsyncVis.
class_docstr_tok: ["Synchronous","Action","Prediction","and","Visualization","pipeline","with","AsyncVis","."]
docstr: Args:
      cfg (CfgNode): configs. Details can be found in
          slowfast/config/defaults.py
      async_vis (AsyncVis object): asynchronous visualizer.
      gpu_id (Optional[int]): GPU id.
docstr_tok: ["Args",":","cfg","(","CfgNode",")",":","configs",".","Details","can","be","found","in","slowfast\/config\/defaults.py","async_vis","(","AsyncVis","object",")",":","asynchronous","visualizer",".","gpu_id","(","Optional","[","int","]",")",":","GPU","id","."]
code: def __init__(self, cfg, async_vis=None, gpu_id=None):
      """
      Args:
          cfg (CfgNode): configs. Details can be found in
              slowfast/config/defaults.py
          async_vis (AsyncVis object): asynchronous visualizer.
          gpu_id (Optional[int]): GPU id.
      """
      self.predictor = Predictor(cfg=cfg, gpu_id=gpu_id)
      self.async_vis = async_vis
  
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 1 to create a new ActionPredictor object  with example: obj = ActionPredictor(cfg, async_vis, gpu_id)