code: def demo(cfg):
      """
      Run inference on an input video or stream from webcam.
      Args:
          cfg (CfgNode): configs. Details can be found in
              slowfast/config/defaults.py
      """
      # AVA format-specific visualization with precomputed boxes.
      if cfg.DETECTION.ENABLE and cfg.DEMO.PREDS_BOXES != "":
          precomputed_box_vis = AVAVisualizerWithPrecomputedBox(cfg)
          precomputed_box_vis()
      else:
          start = time.time()
          if cfg.DEMO.THREAD_ENABLE:
              frame_provider = ThreadVideoManager(cfg)
          else:
              frame_provider = VideoManager(cfg)
  
          for task in tqdm.tqdm(run_demo(cfg, frame_provider)):
              frame_provider.display(task)
  
          frame_provider.join()
          frame_provider.clean()
          logger.info("Finish demo in: {}".format(time.time() - start))
  
file_path: SlowFast/tools/demo_net.py
imports: import numpy
  import time
  import torch
  import tqdm
  from slowfast.utils import logging
  from slowfast.visualization.async_predictor import AsyncDemo, AsyncVis
  from slowfast.visualization.ava_demo_precomputed_boxes import AVAVisualizerWithPrecomputedBox
  from slowfast.visualization.demo_loader import ThreadVideoManager, VideoManager
  from slowfast.visualization.predictor import ActionPredictor
  from slowfast.visualization.video_visualizer import VideoVisualizer
label_desc: Use image node_id 2 for calling a global function with example usage: demo(cfg) without return types