-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobilenetv2_culane.py
117 lines (104 loc) · 2.19 KB
/
mobilenetv2_culane.py
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
109
110
111
112
113
114
115
116
117
net = dict(
type='Detector',
)
backbone = dict(
type='MobileNet',
net='MobileNetV2',
pretrained=True,
out_conv=False,
)
featuremap_out_channel = 1280
featuremap_out_stride = 32
num_points = 72
max_lanes = 4
sample_y = range(589, 230, -1)
heads = dict(type='LaneATT',
anchors_freq_path='.cache/culane_anchors_freq.pt',
topk_anchors=1000)
train_parameters = dict(
conf_threshold=None,
nms_thres=15.,
nms_topk=3000
)
test_parameters = dict(
conf_threshold=0.5,
nms_thres=50,
nms_topk=max_lanes
)
optimizer = dict(
type = 'AdamW',
lr = 0.0003,
)
epochs = 15
batch_size = 8
total_iter = (88880 // batch_size) * epochs
scheduler = dict(
type = 'CosineAnnealingLR',
T_max = total_iter
)
eval_ep = 1
save_ep = 1
img_norm = dict(
mean=[103.939, 116.779, 123.68],
std=[1., 1., 1.]
)
ori_img_w=1640
ori_img_h=590
img_w=640
img_h=360
cut_height=0
train_process = [
dict(type='GenerateLaneLine',
transforms = (
dict(
name = 'Affine',
parameters = dict(
translate_px = dict(
x = (-25, 25),
y = (-10, 10)
),
rotate=(-6, 6),
scale=(0.85, 1.15)
)
),
dict(
name = 'HorizontalFlip',
parameters = dict(
p=0.5
),
)
),
wh = (img_w, img_h),
),
dict(type='ToTensor', keys=['img', 'lane_line']),
]
val_process = [
dict(type='GenerateLaneLine'),
dict(type='ToTensor', keys=['img']),
]
dataset_path = './data/CULane'
dataset_type = 'CULane'
dataset = dict(
train=dict(
type=dataset_type,
data_root=dataset_path,
split='train',
processes=train_process,
),
val=dict(
type=dataset_type,
data_root=dataset_path,
split='test',
processes=val_process,
),
test=dict(
type=dataset_type,
data_root=dataset_path,
split='test',
processes=val_process,
)
)
workers = 12
log_interval = 1000
seed=0
lr_update_by_epoch = False