nwojke / deep_sort

Simple Online Realtime Tracking with a Deep Association Metric
GNU General Public License v3.0
5.28k stars 1.47k forks source link

Too fast to ID switch #111

Open zhouzw87 opened 5 years ago

zhouzw87 commented 5 years ago

Hi, I think deep_sort is a great job. If my detection-module not detected object in one frame, but next frame detected object, ID will change the new ID. The occlusion also is the same situation, one object was occluded in a frame, When it appear again, it's ID will change.

ninghongbo123 commented 5 years ago

yes,I have the same problem as you. And I guess that it will work better if modifying some hyper parameters ,but firstly it is necessary to have a comprehensive understanding of this project. And I am dong so.

Akhtar303nu commented 5 years ago

@zhouzw87 @ninghongbo123 any update about hyper parameter to reduce id Switching Thanks

ss199302 commented 5 years ago

@ninghongbo123 hello!Do you know how to modify the parameters?

ninghongbo123 commented 5 years ago

I had modified these parameter or operating logic : 1.threshold-replace 0.2 by 0.25 2.average the top five features of the track as final distance OR average the top 3rd to 5th features, i.e. remove the top 2 features 3.Every frame will carry out these steps that include tracker.predict() and tracker.update()
regardless of whether or not having a detection. 4.For matching cascade, trackers whose age<=5 are gathered together to associate at the same time @ss199302 @Akhtar303nu

ss199302 commented 5 years ago

@ninghongbo123 Thank you for your answer. How do you modify point 2 in your code?

ninghongbo123 commented 5 years ago
In  nn_matching.py file,  modifying  corresponding code as  below:
      distances.sort(axis=0)    # sorted firstly
      return distances[2:5].mean(axis=0)  #average  2-5  features

@ss199302

ss199302 commented 5 years ago

@ninghongbo123 Thank you for your reply. I have made some modifications according to your code, but the effect is not very good. Is the weight model you use well trained by the authorities?

ss199302 commented 5 years ago

@ninghongbo123 Hello, I'd like to try the fourth point you mentioned. Is it to modify the max age? If not, how to modify it? Why is that? I don't understand. Thank you

ninghongbo123 commented 5 years ago

Any modification you made depends on your application. You need to evaluate it after you have modified some parameters .
I think these two parameters are irrelevant . The max age is just your expectation that the tracker should be removed . And my fourth point aims to give trackers whose age<=5 equal possibility to obtain a detection. @ss199302

ss199302 commented 5 years ago

@ninghongbo123 How do you modify the code for the fourth point? Can you tell me? thank you very much

ciwei123 commented 5 years ago

@ninghongbo123 Hi, After you modified the parameters, what data set did you test? What is the effect? And the mars-small128.pb provided by author is trained just through the Mars datasets?Thank you very much.

Mps24-7uk commented 5 years ago

@ninghongbo123 how could I modify point 4 (age<=5 ) in the code.

anzy0621 commented 5 years ago

@ninghongbo123 how to modify the point 3 and 4 that you mentioned above?

Thank you in advance!

hongsamvo commented 5 years ago

@ninghongbo123 thank you for your suggestion. I am working with vehicle counting project. My detector is not good, some frame it lost the detection and the ID of tracking is not switched. but it lost the tracking bbox after lost detection bbox. Do you have any solution to keep the tracking bbox after lost detection bbox, it will make bbox is smooth and the counting result will better. Thank you very much

ninghongbo123 commented 5 years ago

@hongsamvo
hello !
the performance of detector has a important impact on final result of tracking , so it's better to improve the capabilityof detector as soon as possible . I don't know what your specific application is , but as far as i know , vehicle is far more easier to be detected and be tracking than pedestrian . If it lost detection bbox , you should make sure that the information of lost objects can be preserved until next step . There are some methods to try it , including updating the result of KalmanFilting on the assumption that there is no any lost frames , or adopting a robust feature extracter and raise the weights of feature score , and so on .

hongsamvo commented 5 years ago

@ninghongbo123 Thank you very much for your suggestion. I found a solution that similar with your advise that they assume that there is no lost frames and keep tracking bbox until the id is deleted(https://github.com/abewley/sort/issues/55). I am working counting vehicle. My method base on the intersection between a line and the line which connect the center bbox of the same id in the 2 consecutive frames (https://github.com/guillelopez/python-traffic-counter-with-yolo-and-sort). This solution helped me to improve the counting result. The performance of my detector is not really good and I am trying to improve it.

phungthengoc commented 4 years ago

@hongsamvo HI ban, ban da train lai duoc deepsort cho Vehicle chua a. ? minh cung dang lam project tuong tu nhung train lai cho vehicle bang cosine metric learning thi minh gap nhieu error qua.

hongsamvo commented 4 years ago

@phungthengoc Hi bạn, mình cũng dùng repo cosine metric learning để train, không rõ là bạn gặp error gì?

kurkurzz commented 1 year ago

I believe point number 4 can be modified by referring to this comment:

https://github.com/nwojke/deep_sort/issues/256#issuecomment-902463018