GithubHelp home page GithubHelp logo

Comments (2)

DiegoFernandezC avatar DiegoFernandezC commented on June 25, 2024

Hi @romaintha

The approach for the period parameter to skip frames works a little differently. You can find a demo that uses period here.

The period argument is useful to skip frames and speed up the tracking by running the detector over a few frames.

The short answer is that, is not necessary to call multiple times the tracker_step() because you need to call the tracker.update() method on each frame and the tracker.update() uses the tracker_step() behind the scenes.

On each tracker.update() invocation Norfair runs the tracker_step() method, on this operation Norfair updates some attributes, for example, the hit_counter, and makes a prediction using the Kalman filter for the next position of each object.
As you noticed, this prediction should be executed as many times as the period value to avoid a big error when the detections arrive.
For this reason, the tracker.update() method allows you to not pass detections. This means that you have to run the tracker.update() on every frame. Then, when you get the detections run the tracker.update(detections=detections, period=period) passing the detections to the tracker. This allows Norfair to run the predictions despite not having the detections.

Norfair uses the period argument to compensate the hit_counter to the following tracker.update() invocations without detections.

The code should be looks like this:

for frame in video:
    detections = []
    if frame % period == 0:
        detections = model(frame)
    tracked_objects = tracker.update(detections=detections, period=period)

from norfair.

romaintha avatar romaintha commented on June 25, 2024

I see. Thank you for your answer @DiegoFernandezC

from norfair.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.