supervision icon indicating copy to clipboard operation
supervision copied to clipboard

add support for mmdet tracking

Open rolson24 opened this issue 1 year ago • 3 comments

Description

Feature request from #1381

Add support for MMDetection trackers by modifying from_mmdetection to support importing MMDetection TrackDataSamples into supvervision Detections. This also allows for easy integration with the [MASA tracker] (https://github.com/siyuanliii/masa/tree/1d5d42cdd75276c9a8e918639907916f75a761da)

Type of change

  • [x] New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

Tested with this colab notebook

Any specific deployment considerations

Right now the pre-trained MMDetection models are performing quite poorly for tracking, and the built in config files need to be fixed, but if you train your own detection model and write your own config, they work. All you have to do is call `tracker = init_track_model(TRACKER_CONFIG, device=device)' and then for each frame call:

track_result = inference_mot(tracker, frame,
                        frame_id=frame_idx,
                        video_len=video_info.total_frames,
                        )

rolson24 avatar Jul 26 '24 00:07 rolson24

@rolson24 is there chance tracker can be empty ? If yes we should do same thing we did for mask as well.

onuralpszr avatar Jul 26 '24 00:07 onuralpszr

@rolson24 I won't be able to test it today. I'll leave it to @LinasKo. He should be back on Monday.

SkalskiP avatar Jul 26 '24 06:07 SkalskiP

@rolson24 is there chance tracker can be empty ? If yes we should do same thing we did for mask as well.

I tested it and it seems like if there are no tracks, then pred_track_instances won't exist, so it will just use the pred_instances which are the detection results. But it probably wouldn't hurt to add it especially if there is a tracker that implements pred_track_instances slightly differently.

rolson24 avatar Jul 29 '24 14:07 rolson24