code: def data_generator(
      canvas_size: int,
      num_steps: int = 1000,
      num_objects: int = 1,
      max_omega: float = 0.01,
      miss_prob: float = 0.1,
      det_err_sigma: float = 1.0,
  ):
      actors = [
          Actor(
              max_omega=max_omega,
              miss_prob=miss_prob,
              det_err_sigma=det_err_sigma,
              canvas_size=canvas_size,
          )
          for _ in range(num_objects)
      ]
  
      for step in range(num_steps):
          dets_gt, dets_pred = [], []
  
          for actor in actors:
              det_gt, det_pred = actor.detections(step)
              append_det = True
  
              for past_det in dets_gt:
                  if collision_detected(det_gt, past_det):
                      append_det = False
                      break
  
              dets_gt.append(det_gt)
              if append_det and det_pred is not None:
                  dets_pred.append(det_pred)
  
          dets_gt.reverse()
          dets_pred.reverse()
  
          yield dets_gt, dets_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 1 for calling a global function with example usage: data_generator(canvas_size, num_steps, num_objects, max_omega, miss_prob, det_err_sigma) without return types