supervision icon indicating copy to clipboard operation
supervision copied to clipboard

[ByteTrack] - redesign `update_with_detections` to use IoU to match input `Detections` with `tracker_id`

Open SkalskiP opened this issue 1 year ago • 2 comments

Description

  • Currently, update_with_detections returns the predicted position of boxes, not their actual coordinates received from the detector. Many users have complained about the deterioration of box quality when using ByteTrack. (#743)
  • ByteTrack does not work with segmentation models because masks are not transferred to the update_with_detections output.
  • The Detections.data field is lost after passing through update_with_detections.

All these issues can be resolved by changing the logic in update_with_detections. Instead of mapping values obtained from update_with_tensors to new Detections objects, we should use IoU to map the results of update_with_tensors to input Detections objects. This way, the input xyxy coordinates and the input state of the mask and data fields will be preserved.

For this purpose, we can utilize the already existing function box_iou_batch. The matching procedure has been demonstrated in one of our videos on YouTube.

Additional

  • Note: Please share a Google Colab with minimal code to test the new feature. We know it's additional work, but it will definitely speed up the review process. Each change must be tested by the reviewer. Setting up a local environment to do this is time-consuming. Please ensure that Google Colab can be accessed without any issues (make it public). Thank you! 🙏🏻

SkalskiP avatar Jan 18 '24 21:01 SkalskiP

Hi @SkalskiP! Can I work on this issue? I think I can implement this in the way you want without modifying update_with_tensors and in a pretty simple way.

rolson24 avatar Mar 22 '24 22:03 rolson24

Hi @rolson24 👋🏻! Feel free to submit PR. You will make me very happy.

SkalskiP avatar Mar 22 '24 22:03 SkalskiP

The solution for this issue is implemented via https://github.com/roboflow/supervision/pull/1035. I am closing the issue. Thanks @rolson24 ! 🔥

SkalskiP avatar Mar 25 '24 15:03 SkalskiP