code: def seg_camera(args):
      cap_camera = cv2.VideoCapture(0)
      assert cap_camera.isOpened(), "Fail to open camera"
      width = int(cap_camera.get(cv2.CAP_PROP_FRAME_WIDTH))
      height = int(cap_camera.get(cv2.CAP_PROP_FRAME_HEIGHT))
  
      if args.bg_video_path is not None:
          assert os.path.exists(
              args.bg_video_path
          ), "The --bg_video_path is not existed: {}".format(
              args.bg_video_path
          )
          is_video_bg = True
          cap_bg = cv2.VideoCapture(args.bg_video_path)
          bg_frame_nums = cap_bg.get(cv2.CAP_PROP_FRAME_COUNT)
          bg_frame_idx = 1
      else:
          is_video_bg = False
          bg = get_bg_img(args.bg_img_path, [height, width, 3])
  
      logger.info("Input: camera")
      logger.info("Create predictor...")
      predictor = Predictor(args)
  
      logger.info("Start predicting...")
      while cap_camera.isOpened():
          ret_img, img = cap_camera.read()
          if not ret_img:
              break
  
          if is_video_bg:
              ret_bg, bg = cap_bg.read()
              if not ret_bg:
                  break
              if bg_frame_idx == bg_frame_nums:
                  bg_frame_idx = 1
                  cap_bg.set(cv2.CAP_PROP_POS_FRAMES, 0)
              bg_frame_idx += 1
  
          out = predictor.run(img, bg)
          cv2.imshow("PP-HumanSeg", out)
  
          if cv2.waitKey(1) & 0xFF == ord("q"):
              break
  
      if is_video_bg:
          cap_bg.release()
      cap_camera.release()
  
file_path: PaddleSeg/contrib/PP-HumanSeg/src/seg_demo.py
imports: import argparse
  import os
  import sys
  import cv2
  import numpy
  from tqdm import tqdm
  from paddleseg.utils import get_sys_env, logger, get_image_list
  from infer import Predictor
label_desc: Use image node_id 6 for calling a global function with example usage: seg_camera(args) without return types