code: def generate_video(
      num_steps: int = 500,
      num_objects: int = 10,
      max_omega: float = 0.03,
      miss_prob: float = 0.05,
      det_err_sigma: float = 1.5,
      output_path: str = "demo.avi",
      fps: int = 30,
      canvas_size: int = 800,
  ):
      def _empty_canvas(canvas_size=(canvas_size, canvas_size, 3)):
          img = np.ones(canvas_size, dtype=np.uint8) * 30
          return img
  
      video = cv2.VideoWriter(
          output_path,
          cv2.VideoWriter_fourcc(*"DIVX"),
          fps,
          (canvas_size, canvas_size),
      )
  
      detections_gt = []
      detections_pred = []
  
      data_gen = data_generator(
          canvas_size,
          num_steps,
          num_objects,
          max_omega,
          miss_prob,
          det_err_sigma,
      )
      for dets_gt, dets_pred in data_gen:
          img = _empty_canvas()
  
          # overlay actor shapes
          for det_gt in dets_gt:
              xmin, ymin = det_gt.points[0]
              xmax, ymax = det_gt.points[-1]
              feature = det_gt.embedding
              for channel in range(3):
                  img[
                      int(ymin) : int(ymax),
                      int(xmin) : int(xmax),
                      channel,
                  ] = feature[channel]
  
          video.write(img)
          detections_gt.append(dets_gt)
          detections_pred.append(dets_pred)
      video.release()
      return output_path, detections_gt, detections_pred
  
file_path: norfair/demos/reid/src/video_generator.py
imports: import math
  import random
  import cv2
  import numpy
  from utils import collision_detected, get_color
  from norfair import Detection
label_desc: Use image node_id 2 for calling a global function with example usage: generate_video(num_steps, num_objects, max_omega, miss_prob, det_err_sigma, output_path, fps, canvas_size) and returns: output_path,  detections_gt,  detections_pred, img