trackformer icon indicating copy to clipboard operation
trackformer copied to clipboard

Multi-Class MOT

Open edmuthiah opened this issue 3 years ago • 8 comments

Hello,

Does TrackFormer support multi-class multi-object tracking? If so how do I go about training this?

Thanks :)

edmuthiah avatar Jun 20 '21 06:06 edmuthiah

The MOT and CrowdHuman dataset only support a single class. But the extension to multiple classes should be very straight forward and require little implementation effort.

timmeinhardt avatar Jun 22 '21 14:06 timmeinhardt

Hello, Now I want to try multi-class MOT, but I met the assert error: in util/box_ops.py: assert (boxes1[:, 2:] >= boxes1[:, :2]).all()

When I trained the single class, it happened once only because a large learning rate. but now the learning rate is proper and it doesn't work when I decrease the lr.

Have you met this issue?

Thanks.

JackWoo0831 avatar Apr 03 '22 14:04 JackWoo0831

I never tried to convert the repo to multiple classes. This is definitely possible and should be straightforward. But you need to change the code accordingly.

timmeinhardt avatar Apr 03 '22 14:04 timmeinhardt

Hello, Now I solved this issue. To train in multi-class, you only need to modify a few codes.

  1. change the 'num_classes' in models/init.py. e.g., I want to track objects of 4 classes in VisDrone dataset:
elif args. dataset==' VisDrone':# Edited
    # num_classes=1
    num_classes=4

then the classification head will change the dimension in FC layer accordingly. 2.Most importantly, when generate COCO format annotations, the category id must start with 1 and increase by one, e.g.:

annotations['categories']=[{"supercategory":"vehicle","name":"car","id":1},
{"supercategory":"vehicle","name":"van","id":2},
{"supercategory":"vehicle","name":"truck","id":3},
{"supercategory":"vehicle","name":"bus","id":4}]

JackWoo0831 avatar Apr 06 '22 13:04 JackWoo0831

Great! Is it working now?

timmeinhardt avatar Apr 06 '22 13:04 timmeinhardt

I'm still training, and it seems good. Thank u very much for your excellent work. After some epochs I plan to add some code of showing the class name in visdom, hahaha.

JackWoo0831 avatar Apr 06 '22 13:04 JackWoo0831

Class name in visdom sounds good. :)

timmeinhardt avatar Apr 06 '22 13:04 timmeinhardt

Merhaba, Şimdi bu sorunu çözdüm. Çoklu sınıfta eğitim almak için sadece birkaç kodu değiştirmeniz yeterlidir.

  1. Modeller/init.py içindeki 'num_classes' değerini değiştirin. örneğin, VisDrone veri kümesindeki 4 sınıfın nesnelerini izlemek istiyorum:
elif args. dataset==' VisDrone':# Edited
    # num_classes=1
    num_classes=4

daha sonra sınıflandırma kafası buna göre FC katmanındaki boyutu değiştirecektir. 2.En önemlisi, COCO biçimi ek açıklamaları oluştururken, kategori kimliği 1 ile başlamalı ve birer birer artmalıdır, örneğin:

annotations['categories']=[{"supercategory":"vehicle","name":"car","id":1},
{"supercategory":"vehicle","name":"van","id":2},
{"supercategory":"vehicle","name":"truck","id":3},
{"supercategory":"vehicle","name":"bus","id":4}]

Hello there, is it work ?

bilalorhanlr avatar Jul 28 '22 08:07 bilalorhanlr