code: def test_count(delay):
      #
      # Test trackers count of objects
      #
      for counter_max in [delay + 1, delay + 3]:
          #
          # tests a simple static detection
          #
          tracker = Tracker(
              "euclidean",
              initialization_delay=delay,
              distance_threshold=1,
              hit_counter_max=counter_max,
          )
  
          detections = [Detection(points=np.array([[1, 1]]))]
          for _ in range(delay):
              assert len(tracker.update(detections)) == 0
              assert tracker.total_object_count == 0
              assert tracker.current_object_count == 0
  
          assert len(tracker.update(detections)) == 1
          assert tracker.total_object_count == 1
          assert tracker.current_object_count == 1
  
          for _ in range(delay + 1, 0, -1):
              assert len(tracker.update()) == 1
              assert tracker.total_object_count == 1
              assert tracker.current_object_count == 1
  
          assert len(tracker.update()) == 0
          assert tracker.total_object_count == 1
          assert tracker.current_object_count == 0
  
          detections = [
              Detection(points=np.array([[2, 2]])),
              Detection(points=np.array([[3, 3]])),
          ]
          # test the delay
          for _ in range(delay):
              assert len(tracker.update(detections)) == 0
              assert tracker.total_object_count == 1
              assert tracker.current_object_count == 0
  
          assert len(tracker.update(detections)) == 2
          assert tracker.total_object_count == 3
          assert tracker.current_object_count == 2
  
          for _ in range(delay + 1, 0, -1):
              assert len(tracker.update()) == 2
              assert tracker.total_object_count == 3
              assert tracker.current_object_count == 2
  
          assert len(tracker.update()) == 0
          assert tracker.total_object_count == 3
          assert tracker.current_object_count == 0
  
file_path: norfair/tests/test_tracker.py
imports: import numpy
  import pytest
  from norfair import Detection, FilterPyKalmanFilterFactory, OptimizedKalmanFilterFactory, Tracker
  from norfair.utils import validate_points
label_desc: Use image node_id 7 for calling a global function with example usage: test_count(delay) without return types