Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dcnv3
Commits
dc6de4df
Unverified
Commit
dc6de4df
authored
Nov 14, 2023
by
Zhe Chen
Committed by
GitHub
Nov 14, 2023
Browse files
Fix bug in classification & detection (#252)
* fix drop_path_rate in classification * add ms in detection 3x config
parent
3e083be9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
3 deletions
+133
-3
classification/models/build.py
classification/models/build.py
+1
-0
detection/configs/coco/mask_rcnn_internimage_b_fpn_3x_coco.py
...ction/configs/coco/mask_rcnn_internimage_b_fpn_3x_coco.py
+44
-1
detection/configs/coco/mask_rcnn_internimage_s_fpn_3x_coco.py
...ction/configs/coco/mask_rcnn_internimage_s_fpn_3x_coco.py
+44
-1
detection/configs/coco/mask_rcnn_internimage_t_fpn_3x_coco.py
...ction/configs/coco/mask_rcnn_internimage_t_fpn_3x_coco.py
+44
-1
No files found.
classification/models/build.py
View file @
dc6de4df
...
...
@@ -21,6 +21,7 @@ def build_model(config):
post_norm
=
config
.
MODEL
.
INTERN_IMAGE
.
POST_NORM
,
mlp_ratio
=
config
.
MODEL
.
INTERN_IMAGE
.
MLP_RATIO
,
with_cp
=
config
.
TRAIN
.
USE_CHECKPOINT
,
drop_path_rate
=
config
.
MODEL
.
DROP_PATH_RATE
,
res_post_norm
=
config
.
MODEL
.
INTERN_IMAGE
.
RES_POST_NORM
,
# for InternImage-H/G
dw_kernel_size
=
config
.
MODEL
.
INTERN_IMAGE
.
DW_KERNEL_SIZE
,
# for InternImage-H/G
use_clip_projector
=
config
.
MODEL
.
INTERN_IMAGE
.
USE_CLIP_PROJECTOR
,
# for InternImage-H/G
...
...
detection/configs/coco/mask_rcnn_internimage_b_fpn_3x_coco.py
View file @
dc6de4df
...
...
@@ -32,8 +32,51 @@ model = dict(
in_channels
=
[
112
,
224
,
448
,
896
],
out_channels
=
256
,
num_outs
=
5
))
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
# augmentation strategy originates from DETR / Sparse RCNN
train_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'LoadAnnotations'
,
with_bbox
=
True
,
with_mask
=
True
),
dict
(
type
=
'RandomFlip'
,
flip_ratio
=
0.5
),
dict
(
type
=
'AutoAugment'
,
policies
=
[
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
)
],
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
400
,
1333
),
(
500
,
1333
),
(
600
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
),
dict
(
type
=
'RandomCrop'
,
crop_type
=
'absolute_range'
,
crop_size
=
(
384
,
600
),
allow_negative_crop
=
True
),
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
override
=
True
,
keep_ratio
=
True
)
]
]),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'Pad'
,
size_divisor
=
32
),
dict
(
type
=
'DefaultFormatBundle'
),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
,
'gt_bboxes'
,
'gt_labels'
,
'gt_masks'
]),
]
# By default, models are trained on 8 GPUs with 2 images per GPU
data
=
dict
(
samples_per_gpu
=
2
)
data
=
dict
(
samples_per_gpu
=
2
,
train
=
dict
(
pipeline
=
train_pipeline
))
optimizer
=
dict
(
_delete_
=
True
,
type
=
'AdamW'
,
lr
=
0.0001
,
weight_decay
=
0.05
,
constructor
=
'CustomLayerDecayOptimizerConstructor'
,
...
...
detection/configs/coco/mask_rcnn_internimage_s_fpn_3x_coco.py
View file @
dc6de4df
...
...
@@ -32,8 +32,51 @@ model = dict(
in_channels
=
[
80
,
160
,
320
,
640
],
out_channels
=
256
,
num_outs
=
5
))
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
# augmentation strategy originates from DETR / Sparse RCNN
train_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'LoadAnnotations'
,
with_bbox
=
True
,
with_mask
=
True
),
dict
(
type
=
'RandomFlip'
,
flip_ratio
=
0.5
),
dict
(
type
=
'AutoAugment'
,
policies
=
[
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
)
],
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
400
,
1333
),
(
500
,
1333
),
(
600
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
),
dict
(
type
=
'RandomCrop'
,
crop_type
=
'absolute_range'
,
crop_size
=
(
384
,
600
),
allow_negative_crop
=
True
),
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
override
=
True
,
keep_ratio
=
True
)
]
]),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'Pad'
,
size_divisor
=
32
),
dict
(
type
=
'DefaultFormatBundle'
),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
,
'gt_bboxes'
,
'gt_labels'
,
'gt_masks'
]),
]
# By default, models are trained on 8 GPUs with 2 images per GPU
data
=
dict
(
samples_per_gpu
=
2
)
data
=
dict
(
samples_per_gpu
=
2
,
train
=
dict
(
pipeline
=
train_pipeline
))
optimizer
=
dict
(
_delete_
=
True
,
type
=
'AdamW'
,
lr
=
0.0001
,
weight_decay
=
0.05
,
constructor
=
'CustomLayerDecayOptimizerConstructor'
,
...
...
detection/configs/coco/mask_rcnn_internimage_t_fpn_3x_coco.py
View file @
dc6de4df
...
...
@@ -32,8 +32,51 @@ model = dict(
in_channels
=
[
64
,
128
,
256
,
512
],
out_channels
=
256
,
num_outs
=
5
))
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
# augmentation strategy originates from DETR / Sparse RCNN
train_pipeline
=
[
dict
(
type
=
'LoadImageFromFile'
),
dict
(
type
=
'LoadAnnotations'
,
with_bbox
=
True
,
with_mask
=
True
),
dict
(
type
=
'RandomFlip'
,
flip_ratio
=
0.5
),
dict
(
type
=
'AutoAugment'
,
policies
=
[
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
)
],
[
dict
(
type
=
'Resize'
,
img_scale
=
[(
400
,
1333
),
(
500
,
1333
),
(
600
,
1333
)],
multiscale_mode
=
'value'
,
keep_ratio
=
True
),
dict
(
type
=
'RandomCrop'
,
crop_type
=
'absolute_range'
,
crop_size
=
(
384
,
600
),
allow_negative_crop
=
True
),
dict
(
type
=
'Resize'
,
img_scale
=
[(
480
,
1333
),
(
512
,
1333
),
(
544
,
1333
),
(
576
,
1333
),
(
608
,
1333
),
(
640
,
1333
),
(
672
,
1333
),
(
704
,
1333
),
(
736
,
1333
),
(
768
,
1333
),
(
800
,
1333
)],
multiscale_mode
=
'value'
,
override
=
True
,
keep_ratio
=
True
)
]
]),
dict
(
type
=
'Normalize'
,
**
img_norm_cfg
),
dict
(
type
=
'Pad'
,
size_divisor
=
32
),
dict
(
type
=
'DefaultFormatBundle'
),
dict
(
type
=
'Collect'
,
keys
=
[
'img'
,
'gt_bboxes'
,
'gt_labels'
,
'gt_masks'
]),
]
# By default, models are trained on 8 GPUs with 2 images per GPU
data
=
dict
(
samples_per_gpu
=
2
)
data
=
dict
(
samples_per_gpu
=
2
,
train
=
dict
(
pipeline
=
train_pipeline
))
optimizer
=
dict
(
_delete_
=
True
,
type
=
'AdamW'
,
lr
=
0.0001
,
weight_decay
=
0.05
,
constructor
=
'CustomLayerDecayOptimizerConstructor'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment