ifzhang / ByteTrack

[ECCV 2022] ByteTrack: Multi-Object Tracking by Associating Every Detection Box
MIT License
4.8k stars 906 forks source link

Change BaseTrack attributes to Object attributes #190

Closed dumbPy closed 2 years ago

dumbPy commented 2 years ago

All the attributes are used after object initialisation only, so there is no reason to keep them as Class attributes.
Keeping them as class attributes instead causes #79

This should fix #79 and should not affect any other part.
Have checked that we always call self.next_id() and never call BaseTrack.next_id() i.e., no need for it to be a static method anymore, since all the attributes are now object attributes.

Fixes #79

HanGuangXin commented 2 years ago

Hi, @dumbPy. From the issue https://github.com/ifzhang/ByteTrack/issues/79 you mentioned, it seems this bug has no harm on the performance metrics. Am I right?

dumbPy commented 2 years ago

Yes. I am only changing how the attributes are saved.
Since you always call self.next_id() i.e., call the function in the object, it should not affect performance, or break any code.

feiyang-hku commented 2 years ago

After the changes proposed by @dumbPy, the demo does not run anymore. The Error message is "AttributeError: 'STrack' object has no attribute '_count'"...I have to hard reset the repository to commit b43bae9c016f45cae847e9bfeba739677ad82aad to get it to a functional state again.