-
-
Notifications
You must be signed in to change notification settings - Fork 5
Feat/improve mot and bytetracker #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix: make build_test_pipeline for mot more robust against other transforms
update bytetracker unittest to pytest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances ByteTracker to support instance masks and improves the robustness and performance of multi-object tracking (MOT) inference pipelines.
Key Changes:
- Extended ByteTracker to handle and return instance masks alongside bounding boxes
- Optimized PackTrackInput transformation with smarter memory layout handling (3-5x speedup)
- Made inference_mot more flexible by preserving more transforms from the test pipeline instead of only keeping Resize
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
mmdet/models/trackers/byte_tracker.py |
Added mask tracking capabilities throughout the tracking pipeline |
mmdet/datasets/transforms/formatting.py |
Optimized array operations by checking memory contiguity before transpose |
mmdet/apis/inference.py |
Removed float casting and improved transform filtering logic |
tests/test_models/test_trackers/test_byte_tracker.py |
Converted tests to pytest fixtures and added parameterized tests for mask support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if transform['type'] == 'Resize': | ||
| transform_broadcaster['transforms'] = transform | ||
| filtered_transforms = [] | ||
| filtered_transforms = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a very complicated list comprehension. I looked at it for couple of minutes and I still not completely understand what it does. Especially the bit with any(x in transform['type']. Could you simplify it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, since a transform can also sometimes have a scope in front (mmdet.LoadImage vs. LoadImage).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this comprehension
| if transform['type'] == 'Resize': | ||
| transform_broadcaster['transforms'] = transform | ||
| filtered_transforms = [] | ||
| filtered_transforms = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this comprehension
|
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Be able to use ByteTracker with a pretrained detector.
Modification
BC-breaking (Optional)
Output of inference_mot might be different because we don't cast to float before resizing causing different interpolation to happen
Output of inference_mot might be different because more transforms than just Resize are now used.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist