-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from okotaku/dino-ch
[Feature] Support dino crowdhuman
- Loading branch information
Showing
6 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# dataset settings | ||
dataset_type = 'CrowdHumanDataset' | ||
data_root = 'data/CrowdHuman/' | ||
|
||
file_client_args = dict(backend='disk') | ||
|
||
long_size = 1400 | ||
|
||
train_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='LoadAnnotations', with_bbox=True), | ||
dict(type='RandomFlip', prob=0.5), | ||
dict( | ||
type='RandomChoice', | ||
transforms=[ | ||
[ | ||
dict( | ||
type='RandomChoiceResize', | ||
scales=[ | ||
(480, long_size), (512, long_size), (544, long_size), | ||
(576, long_size), (608, long_size), (640, long_size), | ||
(672, long_size), (704, long_size), (736, long_size), | ||
(768, long_size), (800, long_size) | ||
], | ||
keep_ratio=True) | ||
], | ||
[ | ||
dict( | ||
type='RandomChoiceResize', | ||
# The radio of all image in train dataset < 7 | ||
# follow the original implement | ||
scales=[(400, 5000), (500, 5000), (600, 5000)], | ||
keep_ratio=True), | ||
dict( | ||
type='RandomCrop', | ||
crop_type='absolute_range', | ||
crop_size=(384, 720), | ||
allow_negative_crop=True), | ||
dict( | ||
type='RandomChoiceResize', | ||
scales=[ | ||
(480, long_size), (512, long_size), (544, long_size), | ||
(576, long_size), (608, long_size), (640, long_size), | ||
(672, long_size), (704, long_size), (736, long_size), | ||
(768, long_size), (800, long_size) | ||
], | ||
keep_ratio=True) | ||
] | ||
]), | ||
dict(type='PackDetInputs') | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadImageFromFile', file_client_args=file_client_args), | ||
dict(type='Resize', scale=(long_size, 800), keep_ratio=True), | ||
# If you don't have a gt annotation, delete the pipeline | ||
dict(type='LoadAnnotations', with_bbox=True), | ||
dict( | ||
type='PackDetInputs', | ||
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', | ||
'scale_factor')) | ||
] | ||
train_dataloader = dict( | ||
batch_size=4, | ||
num_workers=4, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
batch_sampler=dict(type='AspectRatioBatchSampler'), | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
ann_file='annotation_train.odgt', | ||
data_prefix=dict(img='Images/'), | ||
filter_cfg=dict(filter_empty_gt=True, min_size=32), | ||
pipeline=train_pipeline)) | ||
val_dataloader = dict( | ||
batch_size=1, | ||
num_workers=2, | ||
persistent_workers=True, | ||
drop_last=False, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
data_root=data_root, | ||
ann_file='annotation_val.odgt', | ||
data_prefix=dict(img='Images/'), | ||
test_mode=True, | ||
pipeline=test_pipeline)) | ||
test_dataloader = val_dataloader | ||
|
||
val_evaluator = dict( | ||
type='CrowdHumanMetric', | ||
ann_file=data_root + 'annotation_val.odgt', | ||
metric=['AP', 'MR', 'JI']) | ||
test_evaluator = val_evaluator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# DINO | ||
|
||
[model page](https://github.com/open-mmlab/mmdetection/blob/dev-3.x/configs/dino/README.md) | ||
|
||
## Results and Models | ||
|
||
#### Box Results | ||
|
||
| Backbone | box AP | Config | Download | | ||
| :---------------------------------: | :----: | :----------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: | | ||
| dino-dino-4scale_r50_crowdhuman | 92.9 | [config](dino-4scale_r50_crowdhuman.py) | [model](https://github.com/okotaku/dethub-weights/releases/download/v0.1.1dino-crowdhuman/dino-4scale_r50_crowdhuman-ebfc9dc7.pth) | | ||
| dino-4scale_r50-pre-lvis_crowdhuman | 92.2 | [config](dino-4scale_r50-pre-lvis_crowdhuman.py) | [model](https://github.com/okotaku/dethub-weights/releases/download/v0.1.1dino-crowdhuman/dino-4scale_r50-pre-lvis_crowdhuman-d54735f1.pth) | |
14 changes: 14 additions & 0 deletions
14
configs/projects/crowdhuman/dino/dino-4scale_r50-pre-lvis_crowdhuman.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
_base_ = [ | ||
'mmdet::_base_/default_runtime.py', | ||
'../../../_base_/models/dino/dino-4scale_r50.py', | ||
'../../../_base_/datasets/crowdhuman/crowdhuman_dino.py', | ||
'../../../_base_/schedules/dino/dino_12e.py' | ||
] | ||
custom_imports = dict(imports=['dethub'], allow_failed_imports=False) | ||
fp16 = dict(loss_scale=512.) | ||
|
||
# model settings | ||
num_classes = 1 | ||
model = dict(bbox_head=dict(num_classes=num_classes)) | ||
|
||
load_from = 'https://github.com/okotaku/dethub-weights/releases/download/v0.1.1dino/dino-4scale_r50_lvis-ea80fe74.pth' # noqa |
14 changes: 14 additions & 0 deletions
14
configs/projects/crowdhuman/dino/dino-4scale_r50_crowdhuman.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
_base_ = [ | ||
'mmdet::_base_/default_runtime.py', | ||
'../../../_base_/models/dino/dino-4scale_r50.py', | ||
'../../../_base_/datasets/crowdhuman/crowdhuman_dino.py', | ||
'../../../_base_/schedules/dino/dino_12e.py' | ||
] | ||
custom_imports = dict(imports=['dethub'], allow_failed_imports=False) | ||
fp16 = dict(loss_scale=512.) | ||
|
||
# model settings | ||
num_classes = 1 | ||
model = dict(bbox_head=dict(num_classes=num_classes)) | ||
|
||
load_from = 'https://download.openmmlab.com/mmdetection/v3.0/dino/dino-4scale_r50_8xb2-12e_coco/dino-4scale_r50_8xb2-12e_coco_20221202_182705-55b2bba2.pth' # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Collections: | ||
- Name: DINO | ||
|
||
Models: | ||
- Name: dino-4scale_r50_crowdhuman | ||
In Collection: DINO | ||
Config: configs/projects/crowdhuman/dino/dino-4scale_r50_crowdhuman.py | ||
Results: | ||
- Task: Object Detection | ||
Dataset: lvis | ||
Metrics: | ||
box AP: 92.9 | ||
Weights: https://github.com/okotaku/dethub-weights/releases/download/v0.1.1dino-crowdhuman/dino-4scale_r50_crowdhuman-ebfc9dc7.pth | ||
- Name: dino-4scale_r50-pre-lvis_crowdhuman | ||
In Collection: DINO | ||
Config: configs/projects/crowdhuman/dino/dino-4scale_r50-pre-lvis_crowdhuman.py | ||
Results: | ||
- Task: Object Detection | ||
Dataset: lvis | ||
Metrics: | ||
box AP: 92.2 | ||
Weights: https://github.com/okotaku/dethub-weights/releases/download/v0.1.1dino-crowdhuman/dino-4scale_r50-pre-lvis_crowdhuman-d54735f1.pth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters