Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some question about how-to-estimate-vehicle-speed-with-computer-vision.ipynb #364

Open
2 tasks done
zzt941006 opened this issue Feb 18, 2025 · 4 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@zzt941006
Copy link

Search before asking

  • I have searched the Roboflow Notebooks issues and found no similar bug report.

Notebook name

notebooks/notebooks
/how-to-estimate-vehicle-speed-with-computer-vision.ipynb

Bug

Hi, I have some problems about estimate vehcle-speed.
First of all:
If I want to test by my video,do you have any experience in setting the values ​​of SOURCE and TARGET according to real w and h?

After that:
how can I show detect classes on frame? I try to modify code: labels.append(f"#{tracker_id} {int(speed)} km/h")
but failed.

Finally I saw some frame car speed greater than 130KM/H, what parameter can I fix to let vehicle speed is more accurate.

Thanks!

Environment

Local
windows 10
py3.8

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@zzt941006 zzt941006 added the bug Something isn't working label Feb 18, 2025
@SkalskiP
Copy link
Collaborator

Hi @zzt941006! Just wondering if you've had a chance to watch my tutorial on YouTube?

@zzt941006
Copy link
Author

Hi @zzt941006! Just wondering if you've had a chance to watch my tutorial on YouTube?

Yes I saw this tutorial,
After that I add some code to show classes on every frame.
But I still can't understand how to set TARGET_WIDTH and TARGET_HEIGHT efficiently.
In my case, cars and buses, truncks speed not more than 60km/h, so if use original params such as TARGET_WIDTH = 25
TARGET_HEIGHT = 250 to estimate speed, some cars speed are 100+ km/h, and then, I modify them to 15, 100 seems work.
However, in different scenarios, TARGET_WIDTH and TARGET_HEIGHT should be adaptive and cannot be adjusted manually all the time. What suggestions do you have in this regard?

@SkalskiP
Copy link
Collaborator

TARGET_WIDTH and TARGET_HEIGHT must be chosen individually based on the actual dimensions of the road. I read my 25x250 dimensions from Google Maps. The solution proposed in this tutorial is not adaptive and requires manual input.

@zzt941006
Copy link
Author

TARGET_WIDTH and TARGET_HEIGHT must be chosen individually based on the actual dimensions of the road. I read my 25x250 dimensions from Google Maps. The solution proposed in this tutorial is not adaptive and requires manual input.

Thanks for apply! Beside this, I also want to know how to evaluate the accuracy of estimated speed.In your tutorial, although the speed is estimated, we cannot judge whether the estimated speed is correct. I find some open dataset, only labeled car's bounding box, rather than speed. So for this problem, do you have any suggestions for me? Looking forward to your reply~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants