forked from voldemortX/pytorch-auto-drive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resnet34_llamas_aug1b.py
101 lines (88 loc) · 2.76 KB
/
resnet34_llamas_aug1b.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
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.llamas_bezier import dataset
from configs.lane_detection.common.datasets.train_level1b_360 import train_augmentation
from configs.lane_detection.common.datasets.test_360 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.matchingloss_bezier import loss
from configs.lane_detection.common.optims.adam00006_dcn import optimizer
from configs.lane_detection.common.optims.ep20_cosine import lr_scheduler
train = dict(
exp_name='resnet34_bezierlanenet-aug2_llamas',
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=(717, 1276),
num_classes=None,
num_epochs=20,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet34_bezierlanenet-aug2_llamas',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet34_bezierlanenet-aug2_llamas/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=1,
ppl=417,
thresh=0.3,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(717, 1276),
max_lane=4,
dataset_name='llamas'
)
model = dict(
name='BezierLaneNet',
image_height=360,
num_regression_parameters=8, # 3 x 2 + 2 = 8 (Cubic Bezier Curve)
# Inference parameters
thresh=0.95,
local_maximum_window_size=9,
# Backbone (3-stage resnet (no dilation) + 2 extra dilated blocks)
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer3',
pretrained=True,
replace_stride_with_dilation=[False, False, False]
),
reducer_cfg=None, # No need here
dilated_blocks_cfg=dict(
name='predefined_dilated_blocks',
in_channels=256,
mid_channels=64,
dilations=[4, 8]
),
# Head, Fusion module
feature_fusion_cfg=dict(
name='FeatureFlipFusion',
channels=256
),
head_cfg=dict(
name='ConvProjection_1D',
num_layers=2,
in_channels=256,
bias=True,
k=3
), # Just some transforms of feature, similar to FCOS heads, but shared between cls & reg branches
# Auxiliary binary segmentation head (automatically discarded in eval() mode)
aux_seg_head_cfg=dict(
name='SimpleSegHead',
in_channels=256,
mid_channels=64,
num_classes=1
)
)