abewley / sort

Simple, online, and realtime tracking of multiple objects in a video sequence.
GNU General Public License v3.0
3.82k stars 1.07k forks source link

Added sort_inter_class.py #142

Closed sarimmehdi closed 8 months ago

sarimmehdi commented 2 years ago

When you have lots of objects belonging to a different class, this will only run sort on objects of the same class. This can be combined with YOLO to track several different objects. What it essentially does is, in the IOU matrix, it assigns a value to 0 to any matched bounding boxes if the class of the two bounding boxes is different.

So, for example, if the bounding box of the Person class matches that of the Bicycle class, the final IoU score will still be made 0 because both are two different classes. While, if the two bounding boxes are of the same class, this will not be done and the original IoU will be used as-is.

haviduck commented 2 years ago

hey man, great stuff. iou batch i think should be castto float32 to avoid the range issue, no?

sarimmehdi commented 2 years ago

@haviduck I didn't encounter any range issues, can you do a test run and check if there is a problem?

haviduck commented 2 years ago

been so long and i dont have a vanilla setup to test. my current code throws index errors, but i csn look into it.

**Update Yeah, it works fine. empty detections threw me for a loop. good job :)

sarimmehdi commented 2 years ago

@abewley @sodabeta7 if there are no issues with this commit, can you please add it to the repo? Thanks