Skip to content

can it do tracking witout detections on every frame ? #39

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

Open
vitalik opened this issue May 3, 2025 · 2 comments
Open

can it do tracking witout detections on every frame ? #39

vitalik opened this issue May 3, 2025 · 2 comments

Comments

@vitalik
Copy link

vitalik commented May 3, 2025

Can trackers tool do tracking without running model inference on every frame ?

def callback(frame, _):
    result = model.infer(frame)[0] # <---- this takes 99% of time
    detections = sv.Detections.from_inference(result)
    detections = tracker.update(detections)

my goal is to track objects on a video close to real time (20-30 fps) while being able to filter what to track using vision model

@rolson24
Copy link

rolson24 commented May 3, 2025

Hi @vitalik!

These object trackers are not really designed to skip frames, however if you have slow moving, or objects that don't change direction very often, you might be able to get away with running the tracker every other frame, but it would probably perform much worse.

@Inferno-P
Copy link

Hey @vitalik 👋

I had a similar problem. I tried the following methods to overcome this:

1. Frame Skipping [Very low effort]: Run model inference only every N frames. This will result in choppy trackers with gaps - but it's a trade off question subjective to implementation details.

2. Motion Estimation [Medium effort]: Once you're skipping frames, you can use good old Open CV to fill in the gaps .by running Optical Flow.
- TIP : Run it with sparse method. Not dense. Speed boost is roughly 30%. 🔥

3. Confidence-based Updates [Risky ⚠ ]: Only update when detection confidence drops below a threshold. This worked for me only in 'some' cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants