After installing the library dependencies listed in the code, just run the ball_detection.py program and try holding a tennis ball in front of the camera on the raspberry pi. The car will follow the ball but if no car is present, at the very least the terminal will print the directions the car is following the ball in so you can see the object tracking magic at work.
https://drive.google.com/file/d/1IEvX9TvzDUre0xdvq78mzYgD-xAQ3wcY/view?usp=share_link