docstr: Args:
      cfg (CfgNode): configs. Details can be found in
          slowfast/config/defaults.py
      n_workers (Optional[int]): number of CPUs for running video visualizer.
          If not given, use all CPUs.
docstr_tok: ["Args",":","cfg","(","CfgNode",")",":","configs",".","Details","can","be","found","in","slowfast\/config\/defaults.py","n_workers","(","Optional","[","int","]",")",":","number","of","CPUs","for","running","video","visualizer",".","If","not","given",",","use","all","CPUs","."]
code: def __init__(self, video_vis, n_workers=None):
      """
      Args:
          cfg (CfgNode): configs. Details can be found in
              slowfast/config/defaults.py
          n_workers (Optional[int]): number of CPUs for running video visualizer.
              If not given, use all CPUs.
      """
  
      num_workers = mp.cpu_count() if n_workers is None else n_workers
  
      self.task_queue = mp.Queue()
      self.result_queue = mp.Queue()
      self.get_indices_ls = []
      self.procs = []
      self.result_data = {}
      self.put_id = -1
      for _ in range(max(num_workers, 1)):
          self.procs.append(
              AsyncVis._VisWorker(
                  video_vis, self.task_queue, self.result_queue
              )
          )
  
      for p in self.procs:
          p.start()
  
      atexit.register(self.shutdown)
  
imports: import atexit
  import numpy
  import queue
  import torch
  import torch.multiprocessing
  import slowfast.utils.logging
  from slowfast.datasets import cv2_transform
  from slowfast.visualization.predictor import Predictor
label_desc: Use image node_id 1 to create a new AsyncVis object  with example: obj = AsyncVis(video_vis, n_workers)