code: def main():
      args = parse_args()
  
      device = torch.device(args.device)
  
      model = init_detector(args.config, args.checkpoint, device=device)
  
      camera = cv2.VideoCapture(args.camera_id)
  
      print('Press "Esc", "q" or "Q" to exit.')
      while True:
          ret_val, img = camera.read()
          result = inference_detector(model, img)
  
          ch = cv2.waitKey(1)
          if ch == 27 or ch == ord("q") or ch == ord("Q"):
              break
  
          model.show_result(
              img,
              result,
              score_thr=args.score_thr,
              wait_time=1,
              show=True,
          )
  
imports: import argparse
  import cv2
  import torch
  from mmdet.apis import inference_detector, init_detector
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types