Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
SkalskiPΒ 
posted an update Jan 17
Post
Real-Time Vehicle Speed Estimation Tutorial πŸš—πŸ’¨πŸ’¨πŸ’¨

TL;DR: Watch the tutorial here: https://www.youtube.com/watch?v=uWP6UjDeZvY

Key Steps:
1. Vehicle Detection: Before we jump into speed estimation, we begin by detecting moving vehicles. I demonstrate this using YOLOv8, deployed through the Inference pip package.

2. Tracking with ByteTrack: For effective object tracking, ByteTrack is my tool of choice. It assigns a unique ID to each vehicle, which is essential for accurately monitoring the distance each car travels. This forms the cornerstone of our speed calculation process.

3. Distance Calculation Complexities: Calculating traveled distance can be tricky due to perspective distortion from the camera. A car moving at a constant speed will appear to move a different number of pixels in the image, depending on its distance from the camera.

4. Vehicle Positioning: We can accurately pinpoint each vehicle's position within our monitored area. By representing each vehicle with x and y coordinates in meters, we can compare its current and past positions, paving the way for calculating its speed.

5. We store the position of each car in the last second, calculate the offset, and divide it by the time delta to get the local speed.

- πŸ”— tutorial: https://www.youtube.com/watch?v=uWP6UjDeZvY
- πŸ”— code: https://github.com/roboflow/supervision/tree/develop/examples/speed_estimation
This comment has been hidden

Will this script also apply for sideways traffic?