forked from Intellindust-AI-Lab/DEIMv2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeimv2_dinov3_s_coco.yml
More file actions
108 lines (93 loc) · 2.77 KB
/
Copy pathdeimv2_dinov3_s_coco.yml
File metadata and controls
108 lines (93 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
__include__: [
'../dataset/coco_detection.yml',
'../runtime.yml',
'../base/dataloader.yml',
'../base/optimizer.yml',
'../base/deimv2.yml',
]
output_dir: ./outputs/deimv2_dinov3_s_coco
DEIM:
backbone: DINOv3STAs
DINOv3STAs:
name: vit_tiny
embed_dim: 192
weights_path: ./ckpts/vitt_distill.pt
interaction_indexes: [3, 7, 11] # only need the [1/8, 1/16, 1/32]
num_heads: 3
HybridEncoder:
in_channels: [192, 192, 192]
depth_mult: 0.67
expansion: 0.34
hidden_dim: 192
dim_feedforward: 512
DEIMTransformer:
feat_channels: [192, 192, 192]
hidden_dim: 192
dim_feedforward: 512
num_layers: 4 # 4 5 6
eval_idx: -1 # -2 -3 -4
## Optimizer
optimizer:
type: AdamW
params:
-
# except norm/bn/bias in self.dinov3
params: '^(?=.*.dinov3)(?!.*(?:norm|bn|bias)).*$'
lr: 0.000025
-
# including all norm/bn/bias in self.dinov3
params: '^(?=.*.dinov3)(?=.*(?:norm|bn|bias)).*$'
lr: 0.000025
weight_decay: 0.
-
# including all norm/bn/bias except for the self.dinov3
params: '^(?=.*(?:sta|encoder|decoder))(?=.*(?:norm|bn|bias)).*$'
weight_decay: 0.
lr: 0.0005
betas: [0.9, 0.999]
weight_decay: 0.0001
# Increase to search for the optimal ema
epoches: 132 # 120 + 4n
## Our LR-Scheduler
flat_epoch: 64 # 4 + epoch // 2, e.g., 40 = 4 + 72 / 2
no_aug_epoch: 12
## Our DataAug
train_dataloader:
dataset:
transforms:
ops:
- {type: Mosaic, output_size: 320, rotation_range: 10, translation_range: [0.1, 0.1], scaling_range: [0.5, 1.5],
probability: 1.0, fill_value: 0, use_cache: True, max_cached_images: 50, random_pop: True}
- {type: RandomPhotometricDistort, p: 0.5}
- {type: RandomZoomOut, fill: 0}
- {type: RandomIoUCrop, p: 0.8}
- {type: SanitizeBoundingBoxes, min_size: 1}
- {type: RandomHorizontalFlip}
- {type: Resize, size: [640, 640], }
- {type: SanitizeBoundingBoxes, min_size: 1}
- {type: ConvertPILImage, dtype: 'float32', scale: True}
- {type: Normalize, mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225]}
- {type: ConvertBoxes, fmt: 'cxcywh', normalize: True}
policy:
epoch: [4, 64, 120] # list
collate_fn:
base_size: 640
mixup_prob: 0.5
ema_restart_decay: 0.9999
base_size_repeat: 20
mixup_epochs: [4, 64]
stop_epoch: 120
copyblend_epochs: [4, 120]
val_dataloader:
dataset:
transforms:
ops:
- {type: Resize, size: [640, 640], }
- {type: ConvertPILImage, dtype: 'float32', scale: True}
- {type: Normalize, mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225]}
DEIMCriterion:
matcher:
# change matcher
change_matcher: True
iou_order_alpha: 4.0
matcher_change_epoch: 100