Skip to content

Commit 38c6ab7

Browse files
committed
nanodet
1 parent 879b153 commit 38c6ab7

File tree

105 files changed

+13025
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+13025
-7
lines changed

config/LiquidDetect.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#Config File example
2+
save_dir: workspace/lqd
3+
model:
4+
weight_averager:
5+
name: ExpMovingAverager
6+
decay: 0.9998
7+
arch:
8+
name: NanoDetPlus
9+
detach_epoch: 10
10+
backbone:
11+
name: ShuffleNetV2
12+
model_size: 1.0x
13+
out_stages: [2,3,4]
14+
activation: LeakyReLU
15+
fpn:
16+
name: GhostPAN
17+
in_channels: [116, 232, 464]
18+
out_channels: 96
19+
kernel_size: 5
20+
num_extra_level: 1
21+
use_depthwise: True
22+
activation: LeakyReLU
23+
head:
24+
name: NanoDetPlusHead
25+
num_classes: 1
26+
input_channel: 96
27+
feat_channels: 96
28+
stacked_convs: 2
29+
kernel_size: 5
30+
strides: [8, 16, 32, 64]
31+
activation: LeakyReLU
32+
reg_max: 7
33+
norm_cfg:
34+
type: BN
35+
loss:
36+
loss_qfl:
37+
name: QualityFocalLoss
38+
use_sigmoid: True
39+
beta: 2.0
40+
loss_weight: 1.0
41+
loss_dfl:
42+
name: DistributionFocalLoss
43+
loss_weight: 0.25
44+
loss_bbox:
45+
name: GIoULoss
46+
loss_weight: 2.0
47+
# Auxiliary head, only use in training time.
48+
aux_head:
49+
name: SimpleConvHead
50+
num_classes: 1
51+
input_channel: 192
52+
feat_channels: 192
53+
stacked_convs: 4
54+
strides: [8, 16, 32, 64]
55+
activation: LeakyReLU
56+
reg_max: 7
57+
58+
class_names: &class_names ['Liquid'] #Please fill in the category names (not include background category)
59+
data:
60+
train:
61+
name: XMLDataset
62+
class_names: *class_names
63+
img_path: lq/train/img
64+
ann_path: lq/train/an
65+
input_size: [320,320] #[w,h]
66+
keep_ratio: True
67+
pipeline:
68+
perspective: 0.0
69+
scale: [0.6, 1.4]
70+
stretch: [[1, 1], [1, 1]]
71+
rotation: 0
72+
shear: 0
73+
translate: 0.2
74+
flip: 0.5
75+
brightness: 0.2
76+
contrast: [0.8, 1.2]
77+
saturation: [0.8, 1.2]
78+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
79+
val:
80+
name: XMLDataset
81+
class_names: *class_names
82+
img_path: lq/valid/img
83+
ann_path: lq/valid/an
84+
input_size: [320,320] #[w,h]
85+
keep_ratio: True
86+
pipeline:
87+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
88+
device:
89+
gpu_ids: [0] # Set like [0, 1, 2, 3] if you have multi-GPUs
90+
workers_per_gpu: 8
91+
batchsize_per_gpu: 4
92+
schedule:
93+
# resume:
94+
# load_model: YOUR_MODEL_PATH
95+
optimizer:
96+
name: AdamW
97+
lr: 0.001
98+
weight_decay: 0.05
99+
warmup:
100+
name: linear
101+
steps: 500
102+
ratio: 0.0001
103+
total_epochs: 300
104+
lr_schedule:
105+
name: CosineAnnealingLR
106+
T_max: 300
107+
eta_min: 0.00005
108+
val_intervals: 10
109+
grad_clip: 35
110+
evaluator:
111+
name: CocoDetectionEvaluator
112+
save_key: mAP
113+
114+
log:
115+
interval: 10

config/LiquidDetect416.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#Config File example
2+
save_dir: workspace/lqd
3+
model:
4+
weight_averager:
5+
name: ExpMovingAverager
6+
decay: 0.9998
7+
arch:
8+
name: NanoDetPlus
9+
detach_epoch: 10
10+
backbone:
11+
name: ShuffleNetV2
12+
model_size: 1.0x
13+
out_stages: [2,3,4]
14+
activation: LeakyReLU
15+
fpn:
16+
name: GhostPAN
17+
in_channels: [116, 232, 464]
18+
out_channels: 96
19+
kernel_size: 5
20+
num_extra_level: 1
21+
use_depthwise: True
22+
activation: LeakyReLU
23+
head:
24+
name: NanoDetPlusHead
25+
num_classes: 1
26+
input_channel: 96
27+
feat_channels: 96
28+
stacked_convs: 2
29+
kernel_size: 5
30+
strides: [8, 16, 32, 64]
31+
activation: LeakyReLU
32+
reg_max: 7
33+
norm_cfg:
34+
type: BN
35+
loss:
36+
loss_qfl:
37+
name: QualityFocalLoss
38+
use_sigmoid: True
39+
beta: 2.0
40+
loss_weight: 1.0
41+
loss_dfl:
42+
name: DistributionFocalLoss
43+
loss_weight: 0.25
44+
loss_bbox:
45+
name: GIoULoss
46+
loss_weight: 2.0
47+
# Auxiliary head, only use in training time.
48+
aux_head:
49+
name: SimpleConvHead
50+
num_classes: 1
51+
input_channel: 192
52+
feat_channels: 192
53+
stacked_convs: 4
54+
strides: [8, 16, 32, 64]
55+
activation: LeakyReLU
56+
reg_max: 7
57+
58+
class_names: &class_names ['Liquid'] #Please fill in the category names (not include background category)
59+
data:
60+
train:
61+
name: XMLDataset
62+
class_names: *class_names
63+
img_path: lq/train/img
64+
ann_path: lq/train/an
65+
input_size: [416,416] #[w,h]
66+
keep_ratio: True
67+
pipeline:
68+
perspective: 0.0
69+
scale: [0.6, 1.4]
70+
stretch: [[1, 1], [1, 1]]
71+
rotation: 0
72+
shear: 0
73+
translate: 0.2
74+
flip: 0.5
75+
brightness: 0.2
76+
contrast: [0.8, 1.2]
77+
saturation: [0.8, 1.2]
78+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
79+
val:
80+
name: XMLDataset
81+
class_names: *class_names
82+
img_path: lq/valid/img
83+
ann_path: lq/valid/an
84+
input_size: [416,416] #[w,h]
85+
keep_ratio: True
86+
pipeline:
87+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
88+
device:
89+
gpu_ids: [0] # Set like [0, 1, 2, 3] if you have multi-GPUs
90+
workers_per_gpu: 8
91+
batchsize_per_gpu: 4
92+
schedule:
93+
# resume:
94+
# load_model: YOUR_MODEL_PATH
95+
optimizer:
96+
name: AdamW
97+
lr: 0.001
98+
weight_decay: 0.05
99+
warmup:
100+
name: linear
101+
steps: 500
102+
ratio: 0.0001
103+
total_epochs: 300
104+
lr_schedule:
105+
name: CosineAnnealingLR
106+
T_max: 300
107+
eta_min: 0.00005
108+
val_intervals: 10
109+
grad_clip: 35
110+
evaluator:
111+
name: CocoDetectionEvaluator
112+
save_key: mAP
113+
114+
log:
115+
interval: 10
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
save_dir: workspace/convnext/nanodet-plus_convnext-nano_640
2+
model:
3+
weight_averager:
4+
name: ExpMovingAverager
5+
decay: 0.9998
6+
arch:
7+
name: NanoDetPlus
8+
detach_epoch: 10
9+
backbone:
10+
name: TIMMWrapper
11+
model_name: convnext_nano
12+
features_only: True
13+
pretrained: True
14+
# output_stride: 32
15+
out_indices: [1, 2, 3]
16+
fpn:
17+
name: GhostPAN
18+
in_channels: [160, 320, 640]
19+
out_channels: 128
20+
kernel_size: 5
21+
num_extra_level: 1
22+
use_depthwise: True
23+
activation: SiLU
24+
head:
25+
name: NanoDetPlusHead
26+
num_classes: 80
27+
input_channel: 128
28+
feat_channels: 128
29+
stacked_convs: 2
30+
kernel_size: 5
31+
strides: [8, 16, 32, 64]
32+
activation: SiLU
33+
reg_max: 7
34+
norm_cfg:
35+
type: BN
36+
loss:
37+
loss_qfl:
38+
name: QualityFocalLoss
39+
use_sigmoid: True
40+
beta: 2.0
41+
loss_weight: 1.0
42+
loss_dfl:
43+
name: DistributionFocalLoss
44+
loss_weight: 0.25
45+
loss_bbox:
46+
name: GIoULoss
47+
loss_weight: 2.0
48+
# Auxiliary head, only use in training time.
49+
aux_head:
50+
name: SimpleConvHead
51+
num_classes: 80
52+
input_channel: 256
53+
feat_channels: 256
54+
stacked_convs: 4
55+
strides: [8, 16, 32, 64]
56+
activation: SiLU
57+
reg_max: 7
58+
data:
59+
train:
60+
name: CocoDataset
61+
img_path: coco/train2017
62+
ann_path: coco/annotations/instances_train2017.json
63+
input_size: [640,640] #[w,h]
64+
keep_ratio: False
65+
pipeline:
66+
perspective: 0.0
67+
scale: [0.1, 2.0]
68+
stretch: [[0.8, 1.2], [0.8, 1.2]]
69+
rotation: 0
70+
shear: 0
71+
translate: 0.2
72+
flip: 0.5
73+
brightness: 0.2
74+
contrast: [0.6, 1.4]
75+
saturation: [0.5, 1.2]
76+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
77+
val:
78+
name: CocoDataset
79+
img_path: coco/val2017
80+
ann_path: coco/annotations/instances_val2017.json
81+
input_size: [640,640] #[w,h]
82+
keep_ratio: False
83+
pipeline:
84+
normalize: [[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]
85+
device:
86+
gpu_ids: [0, 1, 2, 3]
87+
workers_per_gpu: 8
88+
batchsize_per_gpu: 24
89+
schedule:
90+
# resume:
91+
# load_model:
92+
optimizer:
93+
name: AdamW
94+
lr: 0.001
95+
weight_decay: 0.05
96+
no_norm_decay: True
97+
param_level_cfg:
98+
backbone:
99+
lr_mult: 0.1
100+
warmup:
101+
name: linear
102+
steps: 500
103+
ratio: 0.0001
104+
total_epochs: 50
105+
lr_schedule:
106+
name: CosineAnnealingLR
107+
T_max: 50
108+
eta_min: 0.0005
109+
val_intervals: 5
110+
grad_clip: 35
111+
evaluator:
112+
name: CocoDetectionEvaluator
113+
save_key: mAP
114+
log:
115+
interval: 50
116+
117+
class_names: ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
118+
'train', 'truck', 'boat', 'traffic_light', 'fire_hydrant',
119+
'stop_sign', 'parking_meter', 'bench', 'bird', 'cat', 'dog',
120+
'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
121+
'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
122+
'skis', 'snowboard', 'sports_ball', 'kite', 'baseball_bat',
123+
'baseball_glove', 'skateboard', 'surfboard', 'tennis_racket',
124+
'bottle', 'wine_glass', 'cup', 'fork', 'knife', 'spoon', 'bowl',
125+
'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
126+
'hot_dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
127+
'potted_plant', 'bed', 'dining_table', 'toilet', 'tv', 'laptop',
128+
'mouse', 'remote', 'keyboard', 'cell_phone', 'microwave',
129+
'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock',
130+
'vase', 'scissors', 'teddy_bear', 'hair_drier', 'toothbrush']

0 commit comments

Comments
 (0)