-
Notifications
You must be signed in to change notification settings - Fork 139
/
mobilenetv3_large_tusimple.py
88 lines (78 loc) · 2.38 KB
/
mobilenetv3_large_tusimple.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
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.tusimple_seg import dataset
from configs.lane_detection.common.datasets.train_level0_360 import train_augmentation
from configs.lane_detection.common.datasets.test_360 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_7class import loss
from configs.lane_detection.common.optims.sgd009 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='mobilenetv3-large_baseline_tusimple',
workers=10,
batch_size=20,
checkpoint=None,
# Device args
world_size=0,
dist_url='env://',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(360, 640),
original_size=(720, 1280),
num_classes=7,
num_epochs=50,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='mobilenetv3-large_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/mobilenetv3-large_baseline_tusimple/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=10,
ppl=56,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(720, 1280),
max_lane=5,
dataset_name='tusimple'
)
model = dict(
name='DeepLabV1Lane',
backbone_cfg=dict(
# MobileNetV3-Large 1.0
# Manually download https://download.pytorch.org/models/mobilenet_v3_large-8738ca79.pth,
# bug in torch 1.6
name='MobileNetV3Encoder',
pretrained='mobilenet_v3_large-8738ca79.pth',
arch='large',
reduction_factor=1,
# OS-16 (DeepLab style)
strides=(1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1),
dilations=(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2),
out_indices=(16, )
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=960,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=1540,
)
)