Giter VIP home page Giter VIP logo

Comments (4)

SkalskiP avatar SkalskiP commented on June 5, 2024

Hi, @tc360950! 👋🏻 I completely agree that the problem exists. Why do you think storing values from the last pass is enough?

from supervision.

tc360950 avatar tc360950 commented on June 5, 2024

Hi @SkalskiP, removed_tracks collection is only used on line 489

self.lost_tracks = sub_tracks(self.lost_tracks, self.removed_tracks)

where it's used to get rid of lost tracks which have been marked for removal (i.e. those which have not been matched to a detection for a predefined time). Since tracks marked for the removal in the latest pass are added to removed_tracks collection on line 490

self.removed_tracks.extend(removed_stracks)

lost tracks which were removed on pass no. N will actually be removed (i.e. moved to removed_tracks collection) after pass no. N + 1 (which btw is another error, although without any dire consequences). This implies that we must at least do (which is what I propose):

self.removed_tracks = removed_stracks

Now, as to why this is enough. Once a track lands in removed_tracks it does not get out anywhere. I.e. once track is removed from lost_tracks on line 489, it will not reappear there. As a result we do not need to keep whole history, only most recently removed tracks are needed to "sanitize" lost_tracks collection.

I agree that it's a risky change, since there are no unit tests for ByteTrack (I can of course come up with some scripts which compare results from both versions on hand crafted or random data (which I did before raising this issue) but it still seems "not quite right"). There is an open PR with unit tests for ByteTrack. I have not looked at it but maybe that's the best way to introduce this change - add good unit tests for ByteTrack.

from supervision.

SkalskiP avatar SkalskiP commented on June 5, 2024

Hi @tc360950 👋🏻 Thank you for explaining your thought process. The ByteTrack code was transferred to Supervision (with minor changes) from another codebase, which is why it slightly deviates from the writing style we have in Supervision and, as you rightly observed, is not tested at all. Thanks a lot for the analysis you conducted.

from supervision.

SkalskiP avatar SkalskiP commented on June 5, 2024

I'm closing this PR as #1166 was just merged.

from supervision.

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.