Comments (7)
To clarify the comment about calling the update() method even with empty detections. This is because the tracker makes a constant velocity assumption and also will delete object if too many frames have passed without seeing them. By default this is set to 1 so if you don't supply detections at least every second frame the objects will be lost. See lines 226-227.
In the case when you are sub-sampling frames and maintaining a fixed frequency you could simply treat the image sequence as a different framerate and you do not need to call it between frames when you are not doing any detection. Although your code appears to already be doing this.
from sort.
For other people who encounter same issue as me:
After some debugging it got to my attention that the min_hits=3
will remove the tracks if i feed empty detections in,since the min hit only increase when the function is fed detection, so 3 frames with detections in a row will make the counter go to 3, and the updated tracks will be returned. https://github.com/abewley/sort/blob/master/sort.py#L222
Since I'm trying to feed it every frame, and only feed detections every x frame it requires min_hits=1
, so it is able to give tracks back. To solve it either edit the sort.py default value at https://github.com/abewley/sort/blob/master/sort.py#L176 or when creating the object from your script you can give it a new value as input like tracker = Sort(min_hits=1)
Hope this information will help people who encountered the same issue and couldn't figure out a solution.
from sort.
Hey @TheMikeyR
I want to try track with some detect frame skip ,and I have tried your idea above which suggest setting
tracker = Sort(min_hits=1)
but still once I feed empty list, the tracker output returns empty
Then I read over the @abewley commented, which said
By default this is set to 1 so if you don't supply detections at least every second frame the objects will be lost. See lines 226-227.
also with #17 Smmothing detections using tracking , the commented below said
I changed the following line to https://github.com/abewley/sort/blob/master/sort.py#L222
if((trk.time_since_update < self.max_age+1) and (trk.hit_streak >= self.min_hits or self.frame_count <= self.min_hits)):and set min_hits=0 and max_age=4
In my opinion, the line "By default this is set to 1" is refer to parameter max_age
and if we increment the value, the tracker can tolerate every q frames with detection information feed
At the end, by adding self.max_age to Line222 and set
tracker = Sort(max_age=5, min_hits=0)
I could track with every q frames skip (e.g q = 1 or 2 or 3 or 4 )
if q is larger than 5, the max_age has to be larger
not sure I'm doing right, do I miss anything compare to your idea
thanks for any replies
from sort.
@kkyiss really good point, And I'm sorry I've totally missed to add info about max_age
parameter, I believe it is due to the reason that I modified it early in my process and forgot that I modified mine when I tried to get frame skip to work. Mine is set to max_age=10
which makes it able to restore tracks to the old id for a longer timer, since the old id is saved for 10 frames (it can also be dangerous to keep a long history/age, but it seems to work fine with my data).
It looks like you are doing the same steps as I did, so I believe you are doing it right! Thanks for your comment, it will definitely help others who try to achieve the same thing!
from sort.
Arhh, I see! Thanks a lot for your time.
from sort.
I am also trying to skip some frames for detection. But I am having problem in sending empty detections to sort's update function. It gives error in this line when I send an empty list of detections :
trk.update(dets[d,:][0])
IndexError: too many indices for array
from sort.
I understand the role of max_age in the code. It helps to keep the tracker_id alive for the set number of frames and hence would reduce the number of new ids assigned to the same object.
But I am not sure what max_hits is doing? Does it set the minimum number of consecutive detections hits needed to assign the detection a new id if not matched with any other id? Please correct me if I am wrong!
from sort.
Related Issues (20)
- from sort import * causes dead Kenel HOT 1
- running SORT on custom dataset
- missing intermediate IDs HOT 2
- Using SORT when the number of elements to track is constant and known - ideas to recover missidentification and missmatches HOT 6
- C-Python implementation of SORT
- Multi-class multi-object tracking HOT 3
- error in iou__batches HOT 7
- Tracking other objects HOT 2
- Why are FP and FN different for each Tracker method in the paper?
- Preparing RLE for MOTS20 evaluation
- SORT ID for new detection between other old detections
- Logic Error? trk.hit_streak >=self.min_hits, ret.append(...)
- multiclass tracking HOT 3
- can I use this for windows ? because it still show me the same error ?
- No issue, just here for `lap` -> `lapx`
- instalation error
- How to get next state KalmanFilter
- ValueError: operands could not be broadcast together with shapes (0,) (1,3) HOT 1
- Python Version support for SORT
- Converting into Grayscale increasing the inference time ? Is there any way we can increase the model inference time ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sort.