Skip to content
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

Unify model initialization #235

Merged
merged 11 commits into from
Aug 10, 2021
Prev Previous commit
Next Next commit
unify model initialization for mot testing
  • Loading branch information
GT9505 committed Aug 8, 2021
commit 1907e93ec39e3db93fcf2b5f6927bbdf641e0ce3
Original file line number Diff line number Diff line change
@@ -4,17 +4,15 @@
]
model = dict(
type='DeepSORT',
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/tracktor_reid_r50_iter25245-a452f51f.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=False)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(
clip_border=False), num_classes=1))),
bbox_head=dict(bbox_coder=dict(clip_border=False), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth' # noqa: E501
)),
motion=dict(type='KalmanFilter', center_only=False),
reid=dict(
type='BaseReID',
@@ -36,7 +34,12 @@
loss_pairwise=dict(
type='TripletLoss', margin=0.3, loss_weight=1.0),
norm_cfg=dict(type='BN1d'),
act_cfg=dict(type='ReLU'))),
act_cfg=dict(type='ReLU')),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/tracktor_reid_r50_iter25245-a452f51f.pth' # noqa: E501
)),
tracker=dict(
type='SortTracker',
obj_score_thr=0.5,
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@
]
model = dict(
type='DeepSORT',
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=False)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(
clip_border=False), num_classes=1))),
bbox_head=dict(bbox_coder=dict(clip_border=False), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth' # noqa: E501
)),
motion=dict(type='KalmanFilter', center_only=False),
tracker=dict(
type='SortTracker', obj_score_thr=0.5, match_iou_thr=0.5, reid=None))
10 changes: 6 additions & 4 deletions configs/mot/deepsort/sort_faster-rcnn_fpn_4e_mot17-private.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
_base_ = ['./sort_faster-rcnn_fpn_4e_mot17-private-half.py']
model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
)))
data_root = 'data/MOT17/'
test_set = 'train'
data = dict(
10 changes: 6 additions & 4 deletions configs/mot/deepsort/sort_faster-rcnn_fpn_4e_mot17-public.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
_base_ = ['./sort_faster-rcnn_fpn_4e_mot17-public-half.py']
model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
)))
data_root = 'data/MOT17/'
test_set = 'train'
data = dict(
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot15-half_20210804_001040-ae733d0c.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot15_20210803_192157-65b5e2d7.pth' # noqa: E501
),
reid=dict(head=dict(num_classes=375)))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot15-half_20210804_001040-ae733d0c.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=375),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot15_20210803_192157-65b5e2d7.pth' # noqa: E501
)))
# data
data_root = 'data/MOT15/'
data = dict(
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot15-half_20210804_001040-ae733d0c.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot15_20210803_192157-65b5e2d7.pth' # noqa: E501
),
reid=dict(head=dict(num_classes=375)))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot15-half_20210804_001040-ae733d0c.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=375),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot15_20210803_192157-65b5e2d7.pth' # noqa: E501
)))
# data
data_root = 'data/MOT15/'
img_norm_cfg = dict(
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot16-half_20210804_001054-73477869.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot16_20210803_204826-1b3e3cfd.pth' # noqa: E501
),
reid=dict(head=dict(num_classes=375)))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot16-half_20210804_001054-73477869.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=375),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot16_20210803_204826-1b3e3cfd.pth' # noqa: E501
)))
# data
data_root = 'data/MOT16/'
data = dict(
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot16-half_20210804_001054-73477869.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot16_20210803_204826-1b3e3cfd.pth' # noqa: E501
),
reid=dict(head=dict(num_classes=375)))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot16-half_20210804_001054-73477869.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=375),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot16_20210803_204826-1b3e3cfd.pth' # noqa: E501
)))
# data
data_root = 'data/MOT16/'
img_norm_cfg = dict(
Original file line number Diff line number Diff line change
@@ -2,19 +2,18 @@
'../../_base_/models/faster_rcnn_r50_fpn.py',
'../../_base_/datasets/mot_challenge.py', '../../_base_/default_runtime.py'
]

model = dict(
type='Tracktor',
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot17-4bf6b63d.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=False)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(
clip_border=False), num_classes=1))),
bbox_head=dict(bbox_coder=dict(clip_border=False), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-half-64ee2ed4.pth' # noqa: E501
)),
reid=dict(
type='BaseReID',
backbone=dict(
@@ -35,7 +34,12 @@
loss_pairwise=dict(
type='TripletLoss', margin=0.3, loss_weight=1.0),
norm_cfg=dict(type='BN1d'),
act_cfg=dict(type='ReLU'))),
act_cfg=dict(type='ReLU')),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot17-4bf6b63d.pth' # noqa: E501
)),
motion=dict(
type='CameraMotionCompensation',
warp_mode='cv2.MOTION_EUCLIDEAN',
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
)))
# data
data_root = 'data/MOT17/'
test_set = 'train'
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
detector=dict(
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
)))
# data
data_root = 'data/MOT17/'
test_set = 'test'
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20-half_20210805_001244-2c323fd1.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=True)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1))),
reid=dict(head=dict(num_classes=1705)))
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20-half_20210805_001244-2c323fd1.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=1705),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
)))
# data
data_root = 'data/MOT20/'
data = dict(
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20-half_20210805_001244-2c323fd1.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=True)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1))),
reid=dict(head=dict(num_classes=1705)))
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20-half_20210805_001244-2c323fd1.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=1705),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
)))
data_root = 'data/MOT20/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-private-half.py']

model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20_20210804_162232-7fde5e8d.pth', # noqa: E501
reid= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
),
detector=dict(
rpn_head=dict(bbox_coder=dict(clip_border=True)),
roi_head=dict(
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1))),
reid=dict(head=dict(num_classes=1705)))
bbox_head=dict(bbox_coder=dict(clip_border=True), num_classes=1)),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_8e_mot20_20210804_162232-7fde5e8d.pth' # noqa: E501
)),
reid=dict(
head=dict(num_classes=1705),
init_cfg=dict(
type='Pretrained',
checkpoint= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/reid/reid_r50_6e_mot20_20210803_212426-c83b1c01.pth' # noqa: E501
)))
data_root = 'data/MOT20/'
test_set = 'test'
data = dict(
2 changes: 2 additions & 0 deletions mmtrack/apis/inference.py
Original file line number Diff line number Diff line change
@@ -32,6 +32,8 @@ def init_model(config, checkpoint=None, device='cuda:0', cfg_options=None):
if 'detector' in config.model:
config.model.detector.pretrained = None
model = build_model(config.model)
# We need call `init_weights()` to load pretained weights in MOT task.
model.init_weights()
if checkpoint is not None:
map_loc = 'cpu' if device == 'cpu' else None
checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
Loading