-
Notifications
You must be signed in to change notification settings - Fork 597
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
[Feature] Support DanceTrack dataset for MOT #543
Conversation
noahcao
commented
May 3, 2022
•
edited
Loading
edited
- add dataset support for DanceTrack.
- add data conversion tool from DanceTrack label to COCO format.
- add an example config file by QDtrack on DanceTrack.
- the implementation is verified by going through the training and evaluation pipelines.
- edit corresponding documents, English and Chinese.
@@ -0,0 +1,130 @@ | |||
_base_ = [ |
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 file is adapted from the data label conversion file for MOT | ||
# But as Dancetrack does not provide public detections and provides | ||
# official train/val/test splitting, we make necessary adaptation. |
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.
Does Dancetrack dataset share a similar structure of annotations with MOT challenge dataset?
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.
Yes. They have the same label format.
return outputs | ||
|
||
|
||
def parse_dets(dets): |
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.
delete this function since it is not used.
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.
Deleted in the new commit.
|
||
|
||
@DATASETS.register_module() | ||
class DanceTrackDataset(CocoVideoDataset): |
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.
Please inherit from MOTChanllengeDataset
, if they share a similar structure of annotations.
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 have made this change.
_base_ = [ | ||
'../../_base_/models/faster_rcnn_r50_fpn.py', | ||
'../../_base_/datasets/dancetrack.py', '../../_base_/default_runtime.py' | ||
] |
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.
|
||
|
||
@DATASETS.register_module() | ||
class DanceTrackDataset(MOTChallengeDataset): |
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.
Please remove the duplicated codes since we have already inherited from MOTChallengeDataset
.
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.
Removed in the new commit.
Codecov Report
@@ Coverage Diff @@
## master #543 +/- ##
==========================================
+ Coverage 73.08% 73.24% +0.15%
==========================================
Files 129 130 +1
Lines 8019 8074 +55
Branches 1562 1564 +2
==========================================
+ Hits 5861 5914 +53
- Misses 1664 1668 +4
+ Partials 494 492 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
BENCHMARK='DanceTrack', | ||
# Option Values: 'train', 'val', 'test' | ||
SPLIT_TO_EVAL='val', |
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.
The only differences are BENCHMARK
and SPLIT_TO_EVAL
.
We can override the get_benchmark()
in MOTChanllengeDataset
to return both DanceTrack
and val
in order to reuse most codes as far as possiable.
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 not sure your intention, because in this function from mot_challenge_dataset.py
, there is also an operation by
if 'half-train' in self.ann_file:
dataset_config[
'GT_LOC_FORMAT'] = '{gt_folder}/{seq}/gt/gt_half-train.txt'
elif 'half-val' in self.ann_file:
dataset_config[
'GT_LOC_FORMAT'] = '{gt_folder}/{seq}/gt/gt_half-val.txt'
I have made BENCHMARK
returned by an override get_benchmark()
in DanceTrackDataset
in the new commit.
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 create a commit to show the intention.
The if and elif will be skipped, since dancetrack only have train and val split
return parser.parse_args() | ||
|
||
|
||
def parse_gts(gts, is_mot15): |
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.
remove is_mot15
for dancetrack dataset
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.
Done.
_base_ = [ | ||
'../../_base_/models/faster_rcnn_r50_fpn.py', | ||
'../../_base_/datasets/dancetrack.py', '../../_base_/default_runtime.py' | ||
] |
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.
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.
Done.
type='QDTrack', | ||
detector=dict( | ||
backbone=dict( | ||
norm_cfg=dict(requires_grad=False), | ||
style='caffe', | ||
init_cfg=dict( | ||
type='Pretrained', checkpoint='torchvision://resnet50')), | ||
rpn_head=dict(bbox_coder=dict(clip_border=False)), | ||
roi_head=dict( | ||
bbox_head=dict( | ||
loss_bbox=dict(type='L1Loss', loss_weight=1.0), | ||
bbox_coder=dict(clip_border=False), | ||
num_classes=1)), | ||
init_cfg=dict( | ||
type='Pretrained', | ||
checkpoint= # noqa: E251 | ||
'https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco-person/faster_rcnn_r50_fpn_1x_coco-person_20201216_175929-d022e227.pth' # noqa: E501 | ||
)), | ||
track_head=dict( | ||
type='QuasiDenseTrackHead', |
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.
After using base config of ./qdtrack_faster-rcnn_r50_fpn_4e_crowdhuman_mot17-private-half.py, some duplicated keys can be removedd
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 realized that it was a fault to set ./qdtrack_faster-rcnn_r50_fpn_4e_crowdhuman_mot17-private-half.py
as a base because it is based on '../../_base_/datasets/mot_challenge.py'
while the dancetrack qdtrack config shoule be based on '../../_base_/datasets/dancetrack.py'
. I think the right way should be creating a new config based on:
_base_ = [
'../../_base_/models/faster_rcnn_r50_fpn.py',
'../../_base_/datasets/dancetrack.py', '../../_base_/default_runtime.py'
]
Given the rule that different base config files should have no key conflict, the dancetrack qdtrack config file should inherit no config file using '../../_base_/datasets/mot_challenge.py'
. To be precise, if it inherits '../../_base_/datasets/dancetrack.py'
and ./qdtrack_faster-rcnn_r50_fpn_4e_mot17-private-half.py'
at the same time, it raises error
KeyError: "Duplicate key is not allowed among bases. Duplicate keys: {'data_root', 'train_pipeline', 'img_norm_cfg', 'test_pipeline', 'data', 'dataset_type'}"
BENCHMARK='DanceTrack', | ||
# Option Values: 'train', 'val', 'test' | ||
SPLIT_TO_EVAL='val', |
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 create a commit to show the intention.
The if and elif will be skipped, since dancetrack only have train and val split
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.
Reviewed the code. MOT17 config file is verified with given checkpoint to achieve the same HOTA scores.
I refactored the config files to disentangle the config for dataset and the config of model.
* fix format * support dancetrack dataset * delete unused function; inherit dancetrack dataset class from MOTChallenge * remove duplicated content in DancetrackDataset * remove legacy code * refactor DanceTrackDataset class * fix error in dancetrack qdtrack config file * refactor qdtrack config files. * Update dancetrack_dataset.py Co-authored-by: Tao Gong <gt950513@mail.ustc.edu.cn>