Python program to detect objects in frames of a video using open-cv, ultralytics library. Leverages Mac M1 GPU for speeding up object detection by 5x, from 4 fps to 20 fps.
Install the ultralytics libray on your device or virtual environment before running the code.
%pip install ultralytics