Reverse engineered prompt

Build me a simple Python project that can take a road video and estimate the speed of vehicles in it. I want it to detect common vehicle types like cars, bikes, trucks, and buses using YOLOv4, then track each vehicle across frames, find its centroid movement, and use that pixel movement to estimate speed in km per hour.

Please overlay the results on the video so I can actually see the bounding boxes, labels, and speed values while it runs, then save the processed result as a new video file. Use the basic approach from the README, where speed comes from pixel distance between positions, pixel per meter, and video FPS. It should work on a sample input video and be easy to run from one script.

If something is missing, like weights or model files, set it up in a sensible way and leave clear instructions. Please also clean up any rough math or logic issues so the speed calculation is consistent and believable. You can look up current docs online if you need to.

Want more depth? Deep Reverse