-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Fix] fix bug of non-COCO dataset track demo #1504
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1504 +/- ##
=======================================
Coverage 84.45% 84.45%
=======================================
Files 236 236
Lines 20038 20038
Branches 3603 3603
=======================================
Hits 16924 16924
Misses 2233 2233
Partials 881 881
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@daixinghome Thank you very much for your contribution! Could you please sign the CLA? |
|
Sorry for the mistake. Now it's ok~ |
mmpose/apis/inference_tracking.py
Outdated
@@ -36,7 +36,7 @@ def _compute_iou(bboxA, bboxB): | |||
return iou | |||
|
|||
|
|||
def _track_by_iou(res, results_last, thr): | |||
def _track_by_iou(res, results_last, thr, **kwargs): |
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 would recommend not using **kwargs
but it seems there is no other simple solution here. @jin-s13 Do you have any suggestions?
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.
Maybe we can use functools.partial
to unify the interfaces
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.
Maybe we can use
functools.partial
to unify the interfaces
Could you please give an example?
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.
Could you please give an example?
def _track_by_iou(res, results_last, thr):
# track by iou
def _track_by_oks(res, results_last, thr, sigmas):
# track by oks
_track = partial(_track_by_oks, sigmas=dataset_sigmas) if use_oks else _track_by_iou
if use_oks
is True, then _track
acts like the following function
def func(res, results_last, thr):
return _track_by_oks(res, results_last, thr, dataset_sigmas)
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.
Good idea. I've already modified the code with this method :).
* fix bug of non-COCO dataset track demo * update _track_by_oks calling with partial and revert test function Co-authored-by: Xing Dai <xing.dai@shopee.com>
* fix bug of non-COCO dataset track demo * update _track_by_oks calling with partial and revert test function Co-authored-by: Xing Dai <xing.dai@shopee.com>
* fix bug of non-COCO dataset track demo * update _track_by_oks calling with partial and revert test function Co-authored-by: Xing Dai <xing.dai@shopee.com>
Motivation
Fix: #1502
Modification
BC-breaking (Optional)
Use cases (Optional)
Checklist
Before PR:
After PR: