feat: initial HSAP platform

Huaxu Sentinel Active Safety Platform with embedded algorithm code,
Docker Compose setup, and vendored dataset scaffolds for clone-and-run.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-25 16:59:59 +08:00
commit 7c43b44c57
1619 changed files with 373355 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
## Configs
Config files in *PytorchAutoDrive* (`./configs/`) are used to define models,
how they are trained, tested, visualized, *etc*.
### Registry Mechanism
Different to existing class-based registers, we can also register functions.
For functions, you only write static args in your config,
while passing the dynamic ones on-the-fly by:
```
REGISTRY.from_dict(
<config dict for a function/class>,
kwarg1=1, kwarg2=2, ...
)
```
Note that each argument must be keyword (k=v), and some kwargs can overwrite dict configs.
### Use An Existing Config
Modify customized options like the root of your datasets (in `configs/*/common/_*.py`).
### Write A New Config
Copy the config file most similar to your use case and modify it.
Note that you can simply import config parts from `common` or other config files, it is like writing Python.
### Register A New Class/Func
Choose the appropriate registry and register your Class/Func by:
```
@REGISTRY.register()
```
Remember you still need to import this Class/Func for the registering to take effects.
### How To Read The Code
Since you can't just click 'go to definition' in your IDE,
it is suggested to search the directory for each Class/Function by `name` in configs.

View File

@@ -0,0 +1,116 @@
# Baseline
> Not exactly proposed by any paper.
## Method Overview
The segmentation baseline takes semantic segmentation networks and appends a lane existence head. It takes the most classic multi-class segmentation approach, its design originates from the SCNN paper (ResNets and VGG based Deeplab), while the SAD paper explores the use of ENet and ERFNet, later the RESA paper reduced the network width for efficient ResNet baselines, finally the BézierLaneNet paper (this framework) improved these baselines with modern training techniques and fair evaluations, further extended them to modern architectures such as Swin Transformer, RepVGG and MobileNets. Among them, the ERFNet baseline even achieves comparable performance against SOTA methods. However, they are very sensitive to hyper-parameters, see [Wiki](https://github.com/voldemortX/pytorch-auto-drive/wiki/Notes) and the BézierLaneNet Appendix.B for more info. Specifically, the VGG16 backbone corresponds to DeepLab-LargeFOV in SCNN, the ResNet & other backbones correspond to DeepLabV2 (w.o. ASPP) with output channels reduced to 128 as in RESA. We sometimes call them by backbone names for consistency with common practices.
## Results
*Training time estimated with single 2080 Ti.*
*ImageNet pre-training, 3-times average/best.*
*<sup>+</sup> Measured on a single GTX 1080Ti.*
*<sup>#</sup> No pre-training.*
*\* Trained on a 1080 Ti cluster, with CUDA 9.0 PyTorch 1.3, training time is estimated as: single 2080 Ti, mixed precision.*
*\*\* Trained on two 2080ti.*
### TuSimple (test)
| backbone | aug | resolution | training time | precision | accuracy (avg) | accuracy | FP | FN | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| VGG16 | level 0 | 360 x 640 | 1.5h | mix | 93.79% | 93.94% | 0.0998 | 0.1021 | [model](https://drive.google.com/file/d/1ChK0hApqLU0xUiEm4Wul-gNYQDQka151/view?usp=sharing) \| [shell](/tools/shells/vgg16_baseline_tusimple.sh) |
| ResNet18 | level 0 | 360 x 640 | 0.7h | mix | 94.18% | 94.25% | 0.0881 | 0.0894 | [model](https://drive.google.com/file/d/17VKnwsN4WMbpnD4DgaaerppjXybqn-LG/view?usp=sharing) \| [shell](/tools/shells/resnet18_baseline_tusimple.sh) |
| ResNet34 | level 0 | 360 x 640 | 1.1h | mix | 95.23% | 95.31% | 0.0640 | 0.0622 | [model](https://drive.google.com/file/d/1NAck0aQZK_wAHer4xB8xzegxDWk9EFtG/view?usp=sharing) \| [shell](/tools/shells/resnet34_baseline_tusimple.sh) |
| ResNet34 | level 1a | 360 x 640 | 1.2h* | full | 92.14% | 92.68% | 0.1073 | 0.1221 | [model](https://drive.google.com/file/d/1OhN2tWIep9ncKFf-_2RqUEaSJvPK60cn/view?usp=sharing) \| [shell](/tools/shells/resnet34_baseline-aug_tusimple.sh) |
| ResNet50 | level 0 | 360 x 640 | 1.5h | mix | 95.07% | 95.12% | 0.0649 | 0.0653 | [model](https://drive.google.com/file/d/10KBMVGc63kPvqL_2deaLfTfC3fSAtnju/view?usp=sharing) \| [shell](/tools/shells/resnet50_baseline_tusimple.sh) |
| ResNet101 | level 0 | 360 x 640 | 2.6h | mix | 95.15% | 95.19% | 0.0619 | 0.0620 | [model](https://drive.google.com/file/d/1mELtKB3e8ntOmPovhnMphXWKf_bv83ef/view?usp=sharing) \| [shell](/tools/shells/resnet101_baseline_tusimple.sh) |
| ERFNet | level 0 | 360 x 640 | 0.8h | mix | 96.02% | 96.04% | 0.0591 | 0.0365 | [model](https://drive.google.com/file/d/1rLWDP_dkIQ7sBsCEzJi8T7ET1EPghhJJ/view?usp=sharing) \| [shell](/tools/shells/erfnet_baseline_tusimple.sh) |
| ERFNet | level 1a | 360 x 640 | 0.9h* | full | 94.21% | 94.37% | 0.0846 | 0.0770 | [model](https://drive.google.com/file/d/1LPmxT8rnyZL2M08lSLrlvrM0H_hMrFvq/view?usp=sharing) \| [shell](/tools/shells/erfnet_baseline-aug_tusimple.sh) |
| ENet<sup>#</sup> | level 0 | 360 x 640 | 1h<sup>+</sup> | mix | 95.55% | 95.61% | 0.0655 | 0.0503 | [model](https://drive.google.com/file/d/1CNSox62ghs0ArDVJb9mTZ1NVvqSkUNYC/view?usp=sharing) \| [shell](/tools/shells/enet_baseline_tusimple.sh) |
| MobileNetV2 | level 0 | 360 x 640 | 0.5h | mix | 93.98% | 94.07% | 0.0792 | 0.0866 | [model](https://drive.google.com/file/d/1SUqt3BDXSMhAv68F9VIKncY0lDUg9My8/view?usp=sharing) \| [shell](/tools/shells/mobilenetv2_baseline_tusimple.sh) |
| MobileNetV3-Large | level 0 | 360 x 640 | 0.5h | mix | 92.09% | 92.18% | 0.1149 | 0.1322 | [model](https://drive.google.com/file/d/1I5SPlkmC8TnNeANoQGxzP3P1_iVxms3u/view?usp=sharing) \| [shell](/tools/shells/mobilenetv3-large_baseline_tusimple.sh) |
### CULane (test)
| backbone | aug | resolution | training time | precision | F1 (avg) | F1 | normal | crowded | night | no line | shadow | arrow | dazzle<br>light | curve | crossroad | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| VGG16 | level 0 | 288 x 800 | 9.3h | mix | 65.93 | 66.09 | 85.51 | 64.05 | 61.14 | 35.96 | 59.76 | 78.43 | 53.25 | 62.16 | 2224 | [model](https://drive.google.com/file/d/1wVz1a7S1e5Dgy7ERk7E8dqQ8gyK-dWLG/view?usp=sharing) \| [shell](/tools/shells/vgg16_baseline_culane.sh) |
| ResNet18 | level 0 | 288 x 800 | 5.3h | mix | 65.19 | 65.30 | 85.45 | 62.63 | 61.04 | 33.88 | 51.72 | 78.15 | 53.05 | 59.70 | 1915 | [model](https://drive.google.com/file/d/1wkaTp8v1ceXrd6AjRccqpNxxxkd_qg1U/view?usp=sharing) \| [shell](/tools/shells/resnet18_baseline_culane.sh) |
| ResNet34 | level 0 | 288 x 800 | 7.3h | mix | 69.82 | 69.92 | 89.46 | 66.66 | 65.38 | 40.43 | 62.17 | 83.18 | 58.51 | 63.00 | 1713 | [model](https://drive.google.com/file/d/16VIJcd3wDOjFjg3UCVekUPcAb_F1K604/view?usp=sharing) \| [shell](/tools/shells/resnet34_baseline_culane.sh) |
| ResNet50 | level 0 | 288 x 800 | 12.4h | mix | 68.31 | 68.48 | 88.15 | 65.73 | 63.74 | 37.96 | 62.59 | 81.68 | 59.47 | 64.01 | 2046 | [model](https://drive.google.com/file/d/1DYVeH9kdSPhEMA4fsJFdEiw8qOwvQBl8/view?usp=sharing) \| [shell](/tools/shells/resnet50_baseline_culane.sh) |
| ResNet101 | level 0 | 288 x 800 | 20.0h | mix | 71.29 | 71.37 | 90.11 | 67.89 | 67.01 | 43.10 | 70.56 | 85.09 | 61.77 | 65.47 | 1883 | [model](https://drive.google.com/file/d/1iubFjWetsKE2VI4BEIWLDd80gB7IQUaP/view?usp=sharing) \| [shell](/tools/shells/resnet101_baseline_culane.sh) |
| ERFNet | level 0 | 288 x 800 | 6h | mix | 73.40 | 73.49 | 91.48 | 71.27 | 68.09 | 46.76 | 74.47 | 86.09 | 64.18 | 66.89 | 2102 | [model](https://drive.google.com/file/d/16-Q_jZYc9IIKUEHhClSTwZI4ClMeVvQS/view?usp=sharing) \| [shell](/tools/shells/erfnet_baseline_culane.sh) |
| ENet<sup>#</sup> | level 0 | 288 x 800 | 6.4h<sup>+</sup> | mix | 69.39 | 69.90 | 89.26 | 68.15 | 62.99 | 42.43 | 68.59 | 83.10 | 58.49 | 63.23 | 2464 | [model](https://drive.google.com/file/d/1DNgOpAVq87GIPUeAdMP6fnS4LhUmqyRB/view?usp=sharing) \| [shell](/tools/shells/enet_baseline_culane.sh) |
| MobileNetV2 | level 0 | 288 x 800 | 3.0h | mix | 67.34 | 67.41 | 87.82 | 65.09 | 61.46 | 38.15 | 57.34 | 79.29 | 55.89 | 60.29 | 2114 | [model](https://drive.google.com/file/d/1xTW24b0bW_tzeXQc0znHrMrkBK4BL7_t/view?usp=sharing) \| [shell](/tools/shells/mobilenetv2_baseline_culane.sh) |
| MobileNetV3-Large | level 0 | 288 x 800 | 3.0h | mix | 68.27 | 68.42 | 88.20 | 66.33 | 63.08 | 40.41 | 56.15 | 79.81 | 59.15 | 61.96 | 2304 | [model](https://drive.google.com/file/d/1JJ6gGcH6fAwR3UcGAnmdels5Vm8Bz48Q/view?usp=sharing) \| [shell](/tools/shells/mobilenetv3-large_baseline_culane.sh) |
| RepVGG-A0 | level 0 | 288 x 800 | 3.3h** | mix | 70.22 | 70.56 | 89.74 | 67.68 | 65.21 | 42.51 | 67.85 | 83.13 | 60.86 | 63.63 | 2011 | [model](https://drive.google.com/file/d/1IJtM5LT0GTsHHlO0USLpuZLA_KyuLRd_/view?usp=sharing) \| [shell](/tools/shells/repvgg-a0_baseline_culane.sh) |
| RepVGG-A1 | level 0 | 288 x 800 | 4.1h** | mix | 70.73 | 70.85 | 89.92 | 68.60 | 65.43 | 41.99 | 66.64 | 84.78 | 61.38 | 64.85 | 2127 | [model](https://drive.google.com/file/d/1cQMaXCww-a3mPssQK9iFzHJh6SinxcOo/view?usp=sharing) \| [shell](/tools/shells/repvgg-a1_baseline_culane.sh) |
| RepVGG-B0 | level 0 | 288 x 800 | 6.2h** | mix | 71.77 | 71.81 | 90.86 | 69.32 | 66.68 | 43.53 | 67.83 | 85.43 | 59.80 | 66.47 | 2189 | [model](https://drive.google.com/file/d/1NR4n7N7mK3yKvRAWZUbtRYQ0xHM2vL60/view?usp=sharing) \| [shell](/tools/shells/repvgg-b0_baseline_culane.sh) |
| RepVGG-B1g2 | level 0 | 288 x 800 | 10.0h** | mix | 72.08 | 72.20 | 90.85 | 69.31 | 67.94 | 43.81 | 68.45 | 85.85 | 60.64 | 67.69 | 2092 | [model](https://drive.google.com/file/d/1tKo69RroMYMn_v_C51BuHJQDSN0I7R-m/view?usp=sharing) \| [shell](/tools/shells/repvgg-b1g2_baseline_culane.sh) |
| RepVGG-B2 | level 0 | 288 x 800 | 13.2h** | mix | 72.24 | 72.33 | 90.82 | 69.84 | 67.65 | 43.02 | 72.08 | 85.76 | 61.75 | 67.67 | 2000 | [model](https://drive.google.com/file/d/1_3sS5U20lTDIsq5jS4cev0kZaUER9NPH/view?usp=sharing) \| [shell](/tools/shells/repvgg-b2_baseline_culane.sh) |
| Swin-Tiny | level 0 | 288 x 800 | 12.1h** | mix | 69.75 | 69.90 | 89.55 | 68.36 | 63.56 | 42.53 | 61.96 | 82.64 | 60.81 | 65.21 | 2813 | [model](https://drive.google.com/file/d/1YI_pHGVuuWYyTLeUgdZVDS14WoQjPon4/view?usp=sharing) \| [shell](/tools/shells/swin-tiny_baseline_culane.sh) |
### LLAMAS (val)
| backbone | aug | resolution | training time | precision | F1 (avg) | F1 | TP | FP | FN | Precision | Recall | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| VGG16 | level 0 | 360 x 640 | 9.3h | mix | 95.05 | 95.11 | 70263 | 3460 | 3772 | 95.31 | 94.91 | [model](https://drive.google.com/file/d/1k2b7iRw3_YMJDMUsKVjtdOXRdZsXNXnO/view?usp=sharing) \| [shell](/tools/shells/vgg16_baseline_llamas.sh) |
| ResNet34 | level 0 | 360 x 640 | 7.0h | mix | 95.90 | 95.91 | 70841 | 2847 | 3194 | 96.14 | 95.69 | [model](https://drive.google.com/file/d/1YXNgwhQqwxoMkHDbRqAdnuAXIe1IdLSm/view?usp=sharing) \| [shell](/tools/shells/resnet34_baseline_llamas.sh) |
| ERFNet | level 0 | 360 x 640 | 10.9h<sup>+</sup> | mix | 95.94 | 96.13 | 71136 | 2830 | 2899 | 96.17 | 96.08 | [model](https://drive.google.com/file/d/15oNU4iffIPYTuKSCH2j0boRkYmm3-uSh/view?usp=sharing) \| [shell](/tools/shells/erfnet_baseline_llamas.sh) |
Their test performance can be found at the [LLAMAS leaderboard](https://unsupervised-llamas.com/llamas/benchmark_splines).
## Profiling
*FPS is best trial-avg among 3 trials on a 2080 Ti. Post-processing is ignored.*
| backbone | resolution | FPS | FLOPS(G) | Params(M) |
| :---: | :---: | :---: | :---: | :---: |
| VGG16 | 360 x 640 | 56.36 | 214.50 | 20.37 |
| ResNet18 | 360 x 640 | 148.59 | 85.24 | 12.04 |
| ResNet34 | 360 x 640 | 79.97 | 159.60 | 22.15 |
| ResNet50 | 360 x 640 | 50.58 | 177.62 | 24.57 |
| ResNet101 | 360 x 640 | 27.41 | 314.36 | 43.56 |
| ERFNet | 360 x 640 | 85.87 | 26.32 | 2.67 |
| ENet | 360 x 640 | 56.63 | 4.26 | 0.95 |
| MobileNetV2 | 360 x 640 | 126.54 | 4.49 | 2.06 |
| MobileNetV3-Large | 360 x 640 | 104.34 | 3.63 | 3.30 |
| VGG16 | 288 x 800 | 55.31 | 214.50 | 20.15 |
| ResNet18 | 288 x 800 | 136.28 | 85.22 | 11.82 |
| ResNet34 | 288 x 800 | 72.42 | 159.60 | 21.93 |
| ResNet50 | 288 x 800 | 49.41 | 177.60 | 24.35 |
| ResNet101 | 288 x 800 | 27.19 | 314.34 | 43.34 |
| ERFNet | 288 x 800 | 88.76 | 26.26 | 2.68 |
| ENet | 288 x 800 | 57.99 | 4.12 | 0.96 |
| MobileNetV2 | 288 x 800 | 129.24 | 4.41 | 2.00 |
| MobileNetV3-Large | 288 x 800 | 107.83 | 3.56 | 3.25 |
| RepVGG-A0 | 288 x 800 | 162.61 | 207.81 | 9.06 |
| RepVGG-A1 | 288 x 800 | 117.30 | 339.83 | 13.54 |
| RepVGG-B0 | 288 x 800 | 103.68 | 390.83 | 15.09 |
| RepVGG-B1g2 | 288 x 800 | 36.91 | 1166.76 | 42.20 |
| RepVGG-B2 | 288 x 800 | 18.98 | 2310.13 | 81.23 |
| Swin-Tiny | 288 x 800 | 51.90 | 44.24 | 27.72 |
## Citation (if you have to)
```
@inproceedings{pan2018spatial,
title={Spatial as deep: Spatial cnn for traffic scene understanding},
author={Pan, Xingang and Shi, Jianping and Luo, Ping and Wang, Xiaogang and Tang, Xiaoou},
booktitle={AAAI},
year={2018}
}
@inproceedings{feng2022rethinking,
title={Rethinking efficient lane detection via curve modeling},
author={Feng, Zhengyang and Guo, Shaohua and Tan, Xin and Xu, Ke and Wang, Min and Ma, Lizhuang},
booktitle={Computer Vision and Pattern Recognition},
year={2022}
}
```

View File

@@ -0,0 +1,72 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd05 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='enet_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='enet_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/enet_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='ENet',
num_classes=5,
encoder_relu=False,
decoder_relu=True,
dropout_1=0.01,
dropout_2=0.1,
encoder_only=False,
pretrained_weights=None,
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=5 - 1,
flattened_size=4500,
dropout=0.1,
pool='avg'
)
)

View File

@@ -0,0 +1,72 @@
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.sgd04 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='enet_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='enet_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/enet_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='ENet',
num_classes=7,
encoder_relu=False,
decoder_relu=True,
dropout_1=0.01,
dropout_2=0.1,
encoder_only=False,
pretrained_weights=None,
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=7 - 1,
flattened_size=4400,
dropout=0.1,
pool='avg'
)
)

View File

@@ -0,0 +1,69 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='erfnet_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='erfnet_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/erfnet_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='ERFNet',
num_classes=5,
dropout_1=0.1,
dropout_2=0.1,
pretrained_weights='erfnet_encoder_pretrained.pth.tar',
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=5 - 1,
flattened_size=4500,
dropout=0.1,
pool='max'
)
)

View File

@@ -0,0 +1,69 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.llamas_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_5class import loss
from configs.lane_detection.common.optims.sgd05 import optimizer
from configs.lane_detection.common.optims.ep10_poly_warmup200 import lr_scheduler
train = dict(
exp_name='erfnet_baseline_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=5,
num_epochs=10,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='erfnet_baseline_llamas',
workers=10,
batch_size=80,
checkpoint='./checkpoints/erfnet_baseline_llamas/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=1,
ppl=417,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(717, 1276),
max_lane=4,
dataset_name='llamas'
)
model = dict(
name='ERFNet',
num_classes=5,
dropout_1=0.3,
dropout_2=0.3,
pretrained_weights='erfnet_encoder_pretrained.pth.tar',
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=5 - 1,
flattened_size=4400,
dropout=0.3,
pool='max'
)
)

View File

@@ -0,0 +1,69 @@
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.sgd02 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='erfnet_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='erfnet_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/erfnet_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='ERFNet',
num_classes=7,
dropout_1=0.3,
dropout_2=0.3,
pretrained_weights='erfnet_encoder_pretrained.pth.tar',
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=7 - 1,
flattened_size=4400,
dropout=0.3,
pool='max'
)
)

View File

@@ -0,0 +1,69 @@
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_level1a_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.sgd02 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='erfnet_baseline_tusimple-aug',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
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='erfnet_baseline_tusimple-aug',
workers=10,
batch_size=40,
checkpoint='./checkpoints/erfnet_baseline_tusimple-aug/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='ERFNet',
num_classes=7,
dropout_1=0.3,
dropout_2=0.3,
pretrained_weights='erfnet_encoder_pretrained.pth.tar',
lane_classifier_cfg=dict(
name='EDLaneExist',
num_output=7 - 1,
flattened_size=4400,
dropout=0.3,
pool='max'
)
)

View File

@@ -0,0 +1,84 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd009 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='mobilenetv2_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='mobilenetv2_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/mobilenetv2_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='DeepLabV1Lane',
backbone_cfg=dict(
name='MobileNetV2Encoder',
pretrained='https://download.pytorch.org/models/mobilenet_v2-b0353104.pth',
widen_factor=1,
# OS-16 (DeepLab style)
strides=(1, 2, 2, 2, 1, 1, 1),
dilations=(1, 1, 1, 1, 1, 2, 2),
out_indices=(6, )
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=320,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=1125,
)
)

View File

@@ -0,0 +1,84 @@
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='mobilenetv2_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='mobilenetv2_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/mobilenetv2_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(
name='MobileNetV2Encoder',
pretrained='https://download.pytorch.org/models/mobilenet_v2-b0353104.pth',
widen_factor=1,
# OS-16 (DeepLab style)
strides=(1, 2, 2, 2, 1, 1, 1),
dilations=(1, 1, 1, 1, 1, 2, 2),
out_indices=(6, )
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=320,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=1540,
)
)

View File

@@ -0,0 +1,88 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd009 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='mobilenetv3-large_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='mobilenetv3-large_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/mobilenetv3-large_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
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=5,
dilation=1
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=960,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=1125,
)
)

View File

@@ -0,0 +1,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,
)
)

View File

@@ -0,0 +1,80 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='repvgg-a0_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='repvgg-a0_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/repvgg-a0_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='SegRepVGG',
# num_classes=5,
# dropout_1=0.1,
backbone_cfg=dict(
name='RepVggEncoder',
backbone_name='RepVGG-A0',
pretrained=True,
deploy=False
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=1280,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
)
)

View File

@@ -0,0 +1,80 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='repvgg-a1_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='repvgg-a1_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/repvgg-a1_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='SegRepVGG',
# num_classes=5,
# dropout_1=0.1,
backbone_cfg=dict(
name='RepVggEncoder',
backbone_name='RepVGG-A1',
pretrained=True,
deploy=False
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=1280,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
)
)

View File

@@ -0,0 +1,80 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='repvgg-b0_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='repvgg-b0_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/repvgg-b0_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='SegRepVGG',
# num_classes=5,
# dropout_1=0.1,
backbone_cfg=dict(
name='RepVggEncoder',
backbone_name='RepVGG-B0',
pretrained=True,
deploy=False
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=1280,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
)
)

View File

@@ -0,0 +1,80 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='repvgg-b1g2_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='repvgg-b1g2_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/repvgg-b1g2_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='SegRepVGG',
# num_classes=5,
# dropout_1=0.1,
backbone_cfg=dict(
name='RepVggEncoder',
backbone_name='RepVGG-B1g2',
pretrained=True,
deploy=False
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2048,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
)
)

View File

@@ -0,0 +1,80 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='repvgg-b2_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='repvgg-b2_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/repvgg-b2_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='SegRepVGG',
# num_classes=5,
# dropout_1=0.1,
backbone_cfg=dict(
name='RepVggEncoder',
backbone_name='RepVGG-B2',
pretrained=True,
deploy=False
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2560,
reduce=128
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
)
)

View File

@@ -0,0 +1,82 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd008 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup500 import lr_scheduler
train = dict(
exp_name='resnet101_baseline_culane',
workers=4,
batch_size=8,
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='resnet101_baseline_culane',
workers=4,
batch_size=32,
checkpoint='./checkpoints/resnet101_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet101',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2048,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500
)
)

View File

@@ -0,0 +1,82 @@
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.sgd013 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup500 import lr_scheduler
train = dict(
exp_name='resnet101_baseline_tusimple',
workers=4,
batch_size=8,
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='resnet101_baseline_tusimple',
workers=4,
batch_size=32,
checkpoint='./checkpoints/resnet101_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'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet101',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2048,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160
)
)

View File

@@ -0,0 +1,82 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet18_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='resnet18_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet18_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500
)
)

View File

@@ -0,0 +1,82 @@
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.sgd02 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet18_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='resnet18_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet18_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'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160
)
)

View File

@@ -0,0 +1,82 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet34_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='resnet34_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet34_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500
)
)

View File

@@ -0,0 +1,82 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.llamas_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_5class import loss
from configs.lane_detection.common.optims.sgd05 import optimizer
from configs.lane_detection.common.optims.ep18_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet34_baseline_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=5,
num_epochs=18,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='resnet34_baseline_llamas',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet34_baseline_llamas/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=1,
ppl=417,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(717, 1276),
max_lane=4,
dataset_name='llamas'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4400
)
)

View File

@@ -0,0 +1,82 @@
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.sgd02 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet34_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='resnet34_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet34_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'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160
)
)

View File

@@ -0,0 +1,82 @@
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_level1a_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.sgd02 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='resnet34_baseline_tusimple-aug',
workers=8,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
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='resnet34_baseline_tusimple-aug',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet34_baseline_tusimple-aug/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'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160
)
)

View File

@@ -0,0 +1,82 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd008 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup500 import lr_scheduler
train = dict(
exp_name='resnet50_baseline_culane',
workers=4,
batch_size=8,
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True, # Seg-based method or not
)
test = dict(
exp_name='resnet50_baseline_culane',
workers=4,
batch_size=32,
checkpoint='./checkpoints/resnet50_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet50',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2048,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500
)
)

View File

@@ -0,0 +1,82 @@
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.sgd013 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup500 import lr_scheduler
train = dict(
exp_name='resnet50_baseline_tusimple',
workers=4,
batch_size=8,
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='resnet50_baseline_tusimple',
workers=4,
batch_size=32,
checkpoint='./checkpoints/resnet50_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'
)
# Essentially DeepLabV1 without dilation like in SCNN paper
model = dict(
name='standard_segmentation_model',
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet50',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, True, True]
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=2048,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=7,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160
)
)

View File

@@ -0,0 +1,115 @@
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.adamw00006_swin import optimizer
# from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=36,
power=1, # ? Kept for consistency with official repo
warmup_steps=1500,
start_lr_ratio=1e-6,
)
# Default args that can be overridden in commandline
train_args_default = dict(
exp_name='swin-tiny_baseline_culane',
workers=4,
batch_size=8,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints'
)
test_args_default = dict(
exp_name='swin-tiny_baseline_culane',
workers=4,
batch_size=32,
checkpoint='./checkpoints/swin-tiny_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints'
)
# Configs
train = dict(
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=36,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
train.update(train_args_default)
test = dict(
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
test.update(test_args_default)
model = dict(
name='DeepLabV1Lane',
backbone_cfg=dict(
name='SwinTransformer',
pretrain_img_size=(288, 800),
patch_size=4,
in_chans=3,
embed_dim=96,
depths=[2, 2, 6, 2],
num_heads=[3, 6, 12, 24],
window_size=7,
mlp_ratio=4.,
qkv_bias=True,
qk_scale=None,
drop_rate=0.,
attn_drop_rate=0.,
drop_path_rate=0.3,
# norm_layer=nn.LayerNorm,
ape=False,
patch_norm=True,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
use_checkpoint=False,
pretrained='swin_tiny_patch4_window7_224.pth',
chosen_stages=-1,
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=512,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=18000,
),
uper_cfg=dict(
name='UperHead',
in_channels=[96, 192, 384, 768],
channels=512,
align_corners=False,
pool_scales=(1, 2, 3, 6)
)
)

View File

@@ -0,0 +1,102 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.adamw0001_swin import optimizer
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=12,
power=1, # ? Kept for consistency with official repo
warmup_steps=1500,
start_lr_ratio=1e-6,
)
train = dict(
exp_name='swin-tiny_baseline_culane',
workers=5,
batch_size=10,
checkpoint=None,
# Device args
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='swin-tiny_baseline_culane',
workers=4,
batch_size=32,
checkpoint='./checkpoints/swin-tiny_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='DeepLabV1Lane',
backbone_cfg=dict(
name='SwinTransformer',
pretrain_img_size=(288, 800),
patch_size=4,
in_chans=3,
embed_dim=96,
depths=[2, 2, 6, 2],
num_heads=[3, 6, 12, 24],
window_size=7,
mlp_ratio=4.,
qkv_bias=True,
qk_scale=None,
drop_rate=0.,
attn_drop_rate=0.,
drop_path_rate=0.3,
# norm_layer=nn.LayerNorm,
ape=False,
patch_norm=True,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
use_checkpoint=False,
pretrained='swin_tiny_patch4_window7_224.pth',
chosen_stages=2,
),
reducer_cfg=dict(
name='RESAReducer',
in_channels=384,
reduce=128
),
classifier_cfg=dict(
name='DeepLabV1Head',
in_channels=128,
num_classes=5,
dilation=1
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=1125,
)
)

View File

@@ -0,0 +1,67 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_seg import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.segloss_5class import loss
from configs.lane_detection.common.optims.sgd02 import optimizer
from configs.lane_detection.common.optims.ep12_poly_warmup200 import lr_scheduler
train = dict(
exp_name='vgg16_baseline_culane',
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=(288, 800),
original_size=(590, 1640),
num_classes=5,
num_epochs=12,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='vgg16_baseline_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/vgg16_baseline_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=20,
ppl=18,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='DeepLabV1',
num_classes=5,
dropout_1=0.1,
backbone_cfg=dict(
name='VGG16',
pretrained=True
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4500,
)
)

View File

@@ -0,0 +1,68 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.llamas_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_5class import loss
from configs.lane_detection.common.optims.sgd03 import optimizer
from configs.lane_detection.common.optims.ep18_poly_warmup200 import lr_scheduler
train = dict(
exp_name='vgg16_baseline_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=5,
num_epochs=18,
collate_fn=None, # 'dict_collate_fn' for LSTR
seg=True # Seg-based method or not
)
test = dict(
exp_name='vgg16_baseline_llamas',
workers=10,
batch_size=80,
checkpoint='./checkpoints/vgg16_baseline_llamas/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=True,
gap=1,
ppl=417,
thresh=0.3,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(717, 1276),
max_lane=4,
dataset_name='llamas'
)
model = dict(
name='DeepLabV1',
num_classes=5,
dropout_1=0.1,
backbone_cfg=dict(
name='VGG16',
pretrained=True
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=5 - 1,
flattened_size=4400,
)
)

View File

@@ -0,0 +1,68 @@
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.sgd025 import optimizer
from configs.lane_detection.common.optims.ep50_poly_warmup200 import lr_scheduler
train = dict(
exp_name='vgg16_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='vgg16_baseline_tusimple',
workers=10,
batch_size=80,
checkpoint='./checkpoints/vgg16_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='DeepLabV1',
num_classes=7,
dropout_1=0.1,
backbone_cfg=dict(
name='VGG16',
pretrained=True
),
lane_classifier_cfg=dict(
name='SimpleLaneExist',
num_output=7 - 1,
flattened_size=6160,
)
)

View File

@@ -0,0 +1,66 @@
# BézierLaneNet
> [Rethinking Efficient Lane Detection via Curve Modeling](https://arxiv.org/abs/2203.02431) **CVPR 2022**
> [Chinese Video (中文解读)](https://www.bilibili.com/video/BV1Pr4y147bZ?spm_id_from=333.999.0.0)
## Method Overview
State-of-the-art lane detectors are typically based on semantic segmentation (SCNN, RESA) or point detection (LaneATT). However, semantic segmentation requires customized post-processing & cannot deal with a variable number of lanes. Point detection methods are currently anchor-based, with NMS as post-processing. The more natural way would be getting a curve representation directly. Methods like LSTR made the first steps in this direction, but didn't really achieved comparable performance against SOTA methods. BézierLaneNet use a fully convolutional network to predict cubic Bézier curves, the ease of optimization of Bézier control points made it possible for direct curve methods to compete with SOTAs. A fusion of flipped feature maps is also employed to exploit symmetry in the car's front-view. BézierLaneNet (ResNet-34) achieves 75.6 F-1 on CULane, and attained the 1st place (of all published methods) in the LLAMAS leaderboard at its time, while running at 150 FPS in our benchmark.
<div align=center>
<img src="https://user-images.githubusercontent.com/32259501/157155447-81f28ec6-3ebe-42e0-8864-c739d8c44155.png"/>
</div>
For another earlier attempt on learning Bézier curves for lane detection with (almost) the same name BezierLaneNet, please refer to [wiki](https://github.com/voldemortX/pytorch-auto-drive/wiki/Notes) **9. BézierLaneNet disclaimer** and [this repo](https://github.com/mo-vic/BezierLaneNet).
## Results
*Training time estimated with single 2080 Ti.*
*ImageNet pre-training, 3-times average/best.*
### TuSimple (test)
| backbone | aug | resolution | training time | precision | accuracy (avg) | accuracy | FP | FN | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| ResNet18 | level 1b | 360 x 640 | 5.5h | full | 95.01% | 95.41% | 0.0531 | 0.0458 | [model](https://drive.google.com/file/d/10qMdvPBnZP4P88EQXYZxsXZgj7sz6LvS/view?usp=sharing) \| [shell](/tools/shells/resnet18_bezierlanenet_tusimple-aug1b.sh) |
| ResNet34 | level 1b | 360 x 640 | 6.5h | full | 95.17% | 95.65% | 0.0513 | 0.0386 | [model](https://drive.google.com/file/d/1FFn8j2BoUsyj8UbBcfeGWKvCQj9Qg-44/view?usp=sharing) \| [shell](/tools/shells/resnet34_bezierlanenet_tusimple-aug1b.sh) |
### CULane (test)
| backbone | aug | resolution | training time | precision | F1 (avg) | F1 | normal | crowded | night | no line | shadow | arrow | dazzle<br>light | curve | crossroad | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| ResNet18 | level 1b | 288 x 800 | 9.9h | mix | 73.36 | 73.67 | 90.22 | 71.55 | 68.70 | 45.30 | 70.91 | 84.09 | 62.49 | 58.98 | 996 | [model](https://drive.google.com/file/d/1IpfusHvFeMEGe8wv0fer6KF3pH4X2Tj3/view?usp=sharing) \| [shell](/tools/shells/resnet18_bezierlanenet_culane-aug1b.sh) |
| ResNet34 | level 1b | 288 x 800 | 11.0h | mix | 75.30 | 75.57 | 91.59 | 73.20 | 69.90 | 48.05 | 76.74 | 87.16 | 69.20 | 62.45 | 888 | [model](https://drive.google.com/file/d/1342FQeDQKRHMo283jW2T1WDgfgsYbR5q/view?usp=sharing) \| [shell](/tools/shells/resnet34_bezierlanenet_culane-aug1b.sh) |
### LLAMAS (val)
| backbone | aug | resolution | training time | precision | F1 (avg) | F1 | TP | FP | FN | Precision | Recall | |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| ResNet18 | level 1b | 360 x 640 | 5.5h | mix | 95.42 | 95.52 | 70515 | 3102 | 3520 | 95.79 | 95.25 | [model](https://drive.google.com/file/d/1fTQEZnr2wVQ20P3B2AyM3c_dFp5BHKwQ/view?usp=sharing) \| [shell](/tools/shells/resnet18_bezierlanenet_llamas-aug1b.sh) |
| ResNet34 | level 1b | 360 x 640 | 6.1h | mix | 96.04 | 96.11 | 70959 | 2667 | 3076 | 96.38 | 95.85 | [model](https://drive.google.com/file/d/1RhYTJB_VlHL9hFYuwAX_T4Nev9ZIlmHt/view?usp=sharing) \| [shell](/tools/shells/resnet34_bezierlanenet_llamas-aug1b.sh) |
Their test performance can be found at the [LLAMAS leaderboard](https://unsupervised-llamas.com/llamas/benchmark_splines).
## Profiling
*FPS is best trial-avg among 3 trials on a 2080 Ti.*
| backbone | resolution | FPS | FLOPS(G) | Params(M) |
| :---: | :---: | :---: | :---: | :---: |
| ResNet18 | 360 x 640 | 212.83 | 14.77 | 4.10 |
| ResNet34 | 360 x 640 | 149.52 | 29.85 | 9.49 |
| ResNet18 | 288 x 800 | 210.79 | 14.66 | 4.10 |
| ResNet34 | 288 x 800 | 144.65 | 29.54 | 9.49 |
## Citation
```
@inproceedings{feng2022rethinking,
title={Rethinking efficient lane detection via curve modeling},
author={Feng, Zhengyang and Guo, Shaohua and Tan, Xin and Xu, Ke and Wang, Min and Ma, Lizhuang},
booktitle={Computer Vision and Pattern Recognition},
year={2022}
}
```

View File

@@ -0,0 +1,101 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_bezier import dataset
from configs.lane_detection.common.datasets.train_level1b_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 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.ep36_cosine import lr_scheduler
train = dict(
exp_name='resnet18_bezierlanenet_culane-aug2',
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=(288, 800),
original_size=(590, 1640),
num_classes=None,
num_epochs=36,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet18_bezierlanenet_culane-aug2',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet18_bezierlanenet_culane-aug2/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='BezierLaneNet',
image_height=288,
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='resnet18',
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
)
)

View File

@@ -0,0 +1,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='resnet18_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='resnet18_bezierlanenet-aug2_llamas',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet18_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='resnet18',
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
)
)

View File

@@ -0,0 +1,101 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.tusimple_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.ep400_cosine import lr_scheduler
train = dict(
exp_name='resnet18_bezierlanenet_tusimple-aug2',
workers=8,
batch_size=20,
checkpoint=None,
# Device args
world_size=0,
dist_url='env://',
device='cuda',
val_num_steps=0, # >0 not supported
save_dir='./checkpoints',
seg=False, # Seg-based method or not
input_size=(360, 640),
original_size=(720, 1280),
num_classes=None,
num_epochs=400,
collate_fn='dict_collate_fn'
)
test = dict(
exp_name='resnet18_bezierlanenet_tusimple-aug2',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet18_bezierlanenet_tusimple-aug2/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=10,
ppl=56,
thresh=None,
collate_fn='dict_collate_fn',
input_size=(360, 640),
original_size=(720, 1280),
max_lane=5,
dataset_name='tusimple'
)
model = dict(
name='BezierLaneNet',
image_height=360,
num_regression_parameters=8, # 3 x 2 + 2 = 8 (Cubic Bezier Curve)
# Inference parameters
thresh=0.5,
local_maximum_window_size=9,
# Backbone (3-stage resnet (no dilation) + 2 extra dilated blocks)
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18',
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
)
)

View File

@@ -0,0 +1,101 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane_bezier import dataset
from configs.lane_detection.common.datasets.train_level1b_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 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.ep36_cosine import lr_scheduler
train = dict(
exp_name='resnet34_bezierlanenet_culane-aug2',
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=(288, 800),
original_size=(590, 1640),
num_classes=None,
num_epochs=36,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet34_bezierlanenet_culane-aug2',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet34_bezierlanenet_culane-aug2/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='BezierLaneNet',
image_height=288,
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
)
)

View File

@@ -0,0 +1,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
)
)

View File

@@ -0,0 +1,101 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.tusimple_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.ep400_cosine import lr_scheduler
train = dict(
exp_name='resnet34_bezierlanenet_tusimple-aug1b',
workers=8,
batch_size=20,
checkpoint=None,
# Device args
world_size=0,
dist_url='env://',
device='cuda',
val_num_steps=0, # >0 not supported
save_dir='./checkpoints',
seg=False, # Seg-based method or not
input_size=(360, 640),
original_size=(720, 1280),
num_classes=None,
num_epochs=400,
collate_fn='dict_collate_fn'
)
test = dict(
exp_name='resnet34_bezierlanenet_tusimple-aug1b',
workers=0,
batch_size=1,
checkpoint='./checkpoints/resnet34_bezierlanenet_tusimple-aug1b/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=10,
ppl=56,
thresh=None,
collate_fn='dict_collate_fn',
input_size=(360, 640),
original_size=(720, 1280),
max_lane=5,
dataset_name='tusimple'
)
model = dict(
name='BezierLaneNet',
image_height=360,
num_regression_parameters=8, # 3 x 2 + 2 = 8 (Cubic Bezier Curve)
# Inference parameters
thresh=0.5,
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
)
)

View File

@@ -0,0 +1,19 @@
from importmagician import import_from
with import_from('./'):
# 1. Import from the corresponding config
# Or you can just copy-paste (if your config filename includes - or something)
from configs.lane_detection.bezierlanenet.resnet34_culane_aug1b import *
# 2. Define vis_dataset
from configs.lane_detection.common.datasets._utils import CULANE_ROOT
vis_dataset = dict(
name='CULaneVis',
root_dataset=CULANE_ROOT,
root_output='./test_culane_vis',
root_keypoint=None,
image_set='val'
)
# 3. You can optionally overwrite things, like
# test['checkpoint'] = './resnet34_bezierlanenet_culane_aug2_20211109.pt'

View File

@@ -0,0 +1,16 @@
from importmagician import import_from
with import_from('./'):
# 1. Import from the corresponding config
# Or you can just copy-paste (if your config filename includes - or something)
from configs.lane_detection.bezierlanenet.resnet34_tusimple_aug1b import *
# 2. Define vis_dataset
from configs.lane_detection.common.datasets._utils import TUSIMPLE_ROOT
vis_dataset = dict(
name='TuSimpleVis',
root_dataset=TUSIMPLE_ROOT,
root_output='./test_tusimple_vis',
keypoint_json="./tusimple_pred.json",
image_set='test'
)

View File

@@ -0,0 +1,3 @@
CULANE_ROOT = '../../dataset/culane'
TUSIMPLE_ROOT = '../../dataset/tusimple'
LLAMAS_ROOT = '../../dataset/llamas'

View File

@@ -0,0 +1,8 @@
from ._utils import CULANE_ROOT
dataset = dict(
name='CULane',
image_set='train', # Only set for training. Testing will override this value by --state.
root=CULANE_ROOT,
padding_mask=False
)

View File

@@ -0,0 +1,9 @@
from ._utils import CULANE_ROOT
dataset = dict(
name='CULaneAsBezier',
image_set='train', # Only set for training. Testing will override this value by --state.
root=CULANE_ROOT,
order=3,
aux_segmentation=True
)

View File

@@ -0,0 +1,7 @@
from ._utils import CULANE_ROOT
dataset = dict(
name='CULaneAsSegmentation',
image_set='train', # Only set for training. Testing will override this value by --state.
root=CULANE_ROOT
)

View File

@@ -0,0 +1,8 @@
from ._utils import LLAMAS_ROOT
dataset = dict(
name='LLAMAS',
image_set='train', # Only set for training. Testing will override this value by --state.
root=LLAMAS_ROOT,
padding_mask=False
)

View File

@@ -0,0 +1,9 @@
from ._utils import LLAMAS_ROOT
dataset = dict(
name='LLAMAS_AsBezier',
image_set='train', # Only set for training. Testing will override this value by --state.
root=LLAMAS_ROOT,
order=3,
aux_segmentation=True
)

View File

@@ -0,0 +1,7 @@
from ._utils import LLAMAS_ROOT
dataset = dict(
name='LLAMAS_AsSegmentation',
image_set='train', # Only set for training. Testing will override this value by --state.
root=LLAMAS_ROOT
)

View File

@@ -0,0 +1,18 @@
test_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(288, 800),
size_label=(288, 800)
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]
)
]
)

View File

@@ -0,0 +1,18 @@
test_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]
)
]
)

View File

@@ -0,0 +1,24 @@
# Aug level: simple
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(288, 800),
size_label=(288, 800)
),
dict(
name='RandomRotation',
degrees=3
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True
)
]
)

View File

@@ -0,0 +1,24 @@
# Aug level: simple
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='RandomRotation',
degrees=3
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True
)
]
)

View File

@@ -0,0 +1,56 @@
# Aug level: strong
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomApply',
apply_prob=10/11,
transforms=[
dict(
name='RandomRotation',
degrees=10
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='RandomCrop',
size=(int(590 * 0.9), int(1640 * 0.9))
)
]
),
dict(
name='Resize',
size_image=(288, 800),
size_label=(288, 800)
),
dict(
name='ColorJitter',
brightness=0.4,
contrast=0.4,
saturation=0.4,
hue=0.2
),
dict(
name='ToTensor'
),
dict(
name='RandomLighting',
mean=0.0,
std=0.1,
eigen_value=[0.00341571, 0.01817699, 0.2141788],
eigen_vector=[
[0.41340352, -0.69563484, -0.58752847],
[-0.81221408, 0.00994535, -0.5832747],
[0.41158938, 0.71832671, -0.56089297]
]
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True
)
]
)

View File

@@ -0,0 +1,56 @@
# Aug level: strong
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomApply',
apply_prob=10/11,
transforms=[
dict(
name='RandomRotation',
degrees=10
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='RandomCrop',
size=(int(720 * 0.9), int(1280 * 0.9))
)
]
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ColorJitter',
brightness=0.4,
contrast=0.4,
saturation=0.4,
hue=0.2
),
dict(
name='ToTensor'
),
dict(
name='RandomLighting',
mean=0.0,
std=0.1,
eigen_value=[0.00341571, 0.01817699, 0.2141788],
eigen_vector=[
[0.41340352, -0.69563484, -0.58752847],
[-0.81221408, 0.00994535, -0.5832747],
[0.41158938, 0.71832671, -0.56089297]
]
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True
)
]
)

View File

@@ -0,0 +1,56 @@
# Aug level: strong
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomApply',
apply_prob=10/11,
transforms=[
dict(
name='RandomRotation',
degrees=10
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='RandomCrop',
size=(int(717 * 0.9), int(1276 * 0.9)) # LLAMAS size
)
]
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ColorJitter',
brightness=0.4,
contrast=0.4,
saturation=0.4,
hue=0.2
),
dict(
name='ToTensor'
),
dict(
name='RandomLighting',
mean=0.0,
std=0.1,
eigen_value=[0.00341571, 0.01817699, 0.2141788],
eigen_vector=[
[0.41340352, -0.69563484, -0.58752847],
[-0.81221408, 0.00994535, -0.5832747],
[0.41158938, 0.71832671, -0.56089297]
]
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True
)
]
)

View File

@@ -0,0 +1,41 @@
# Aug level: strong-B (w.o. random lighting, more random affine like LaneATT)
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomAffine',
degrees=(-10, 10),
scale=(0.8, 1.2),
translate=(50, 20),
ignore_x=None
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5,
ignore_x=None
),
dict(
name='Resize',
size_image=(288, 800),
size_label=(288, 800),
ignore_x=None
),
dict(
name='ColorJitter',
brightness=0.3,
contrast=0.3,
saturation=0.3,
hue=0.15
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True,
ignore_x=None
)
]
)

View File

@@ -0,0 +1,41 @@
# Aug level: strong-B (w.o. random lighting, more random affine like LaneATT)
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomAffine',
degrees=(-10, 10),
scale=(0.8, 1.2),
translate=(50, 20),
ignore_x=None
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5,
ignore_x=None
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640),
ignore_x=None
),
dict(
name='ColorJitter',
brightness=0.3,
contrast=0.3,
saturation=0.3,
hue=0.15
),
dict(
name='ToTensor'
),
dict(
name='Normalize',
mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225],
normalize_target=True,
ignore_x=None
)
]
)

View File

@@ -0,0 +1,8 @@
from ._utils import TUSIMPLE_ROOT
dataset = dict(
name='TuSimple',
image_set='train', # Only set for training. Testing will override this value by --state.
root=TUSIMPLE_ROOT,
padding_mask=False
)

View File

@@ -0,0 +1,9 @@
from ._utils import TUSIMPLE_ROOT
dataset = dict(
name='TuSimpleAsBezier',
image_set='train', # Only set for training. Testing will override this value by --state.
root=TUSIMPLE_ROOT,
order=3,
aux_segmentation=True
)

View File

@@ -0,0 +1,7 @@
from ._utils import TUSIMPLE_ROOT
dataset = dict(
name='TuSimpleAsSegmentation',
image_set='train', # Only set for training. Testing will override this value by --state.
root=TUSIMPLE_ROOT
)

View File

@@ -0,0 +1,5 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='Adam',
lr=0.00025
)

View File

@@ -0,0 +1,15 @@
lr = 0.0006
optimizer = dict(
name='torch_optimizer',
torch_optim_class='Adam',
lr=lr,
parameters=[
dict(
params='conv_offset',
lr=lr * 0.1 # 1/10 lr for DCNv2 offsets
),
dict(
params='__others__'
)
]
)

View File

@@ -0,0 +1,24 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='AdamW',
lr=0.00006,
betas=(0.9, 0.999),
weight_decay=0.01,
parameters=[
dict(
params='absolute_pos_embed',
weight_decay=0
),
dict(
params='relative_position_bias_table',
weight_decay=0
),
dict(
params='norm',
weight_decay=0
),
dict(
params='__others__'
)
]
)

View File

@@ -0,0 +1,24 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='AdamW',
lr=0.0001,
betas=(0.9, 0.999),
weight_decay=0.01,
parameters=[
dict(
params='absolute_pos_embed',
weight_decay=0
),
dict(
params='relative_position_bias_table',
weight_decay=0
),
dict(
params='norm',
weight_decay=0
),
dict(
params='__others__'
)
]
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=10,
power=0.9,
warmup_steps=200
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=12,
power=0.9,
warmup_steps=200
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=12,
power=0.9,
warmup_steps=500
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=12,
power=0.9,
warmup_steps=600
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='step_scheduler',
epochs=150,
step_ratio=0.9,
gamma=0.1
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=18,
power=0.9,
warmup_steps=200
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='step_scheduler',
epochs=2000,
step_ratio=0.9,
gamma=0.1
)

View File

@@ -0,0 +1,4 @@
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=20
)

View File

@@ -0,0 +1,4 @@
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=36
)

View File

@@ -0,0 +1,4 @@
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=400
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=50,
power=0.9,
warmup_steps=200
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=50,
power=0.9,
warmup_steps=250
)

View File

@@ -0,0 +1,6 @@
lr_scheduler = dict(
name='poly_scheduler_with_warmup',
epochs=50,
power=0.9,
warmup_steps=500
)

View File

@@ -0,0 +1,14 @@
loss = dict(
name='HungarianBezierLoss',
weight=[0.4, 1],
weight_seg=[0.4, 1],
curve_weight=1,
label_weight=0.1,
seg_weight=0.75,
alpha=0.8,
num_sample_points=100,
bezier_order=3,
k=9, # for the local maximum prior
reduction='mean',
ignore_index=255
)

View File

@@ -0,0 +1,7 @@
loss = dict(
name='HungarianLoss',
upper_weight=2,
lower_weight=2,
curve_weight=5,
label_weight=3
)

View File

@@ -0,0 +1,6 @@
loss = dict(
name='LaneLoss',
existence_weight=0.1,
ignore_index=255,
weight=[0.4, 1, 1, 1, 1]
)

View File

@@ -0,0 +1,6 @@
loss = dict(
name='LaneLoss',
existence_weight=0.1,
ignore_index=255,
weight=[0.4, 1, 1, 1, 1, 1, 1]
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.048,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.06,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.08,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.09,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.1,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.13,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.2,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.25,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.3,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.35,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.4,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.5,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.6,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,7 @@
optimizer = dict(
name='torch_optimizer',
torch_optim_class='SGD',
lr=0.8,
momentum=0.9,
weight_decay=1e-4
)

View File

@@ -0,0 +1,156 @@
# Data pipeline
# from configs.lane_detection.common.datasets.culane import dataset
# from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
# from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
# from configs.lane_detection.common.optims.matchingloss_polynomial import loss
# from configs.lane_detection.common.optims.adam000025 import optimizer
# from configs.lane_detection.common.optims.ep150_step import lr_scheduler
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=15,
)
from configs.lane_detection.common.datasets._utils import CULANE_ROOT
dataset = dict(
name='CULane',
image_set='train', # Only set for training. Testing will override this value by --state.
root=CULANE_ROOT,
padding_mask=False,
is_process=False,
)
optimizer = dict(
name='torch_optimizer',
torch_optim_class='Adam',
lr=0.0003
)
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomAffine',
degrees=(-6, 6),
translate=(25, 10),
scale=(0.85, 1.15),
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='LaneATTLabelFormat',
num_points=72,
image_size=(360, 640),
max_lanes=4
),
dict(
name='ToTensor' # div 255 ???
),
]
)
test_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ToTensor'
),
]
)
loss = dict(
name='LaneAttLoss',
cls_weight=10.,
reg_weight=1.,
alpha=0.25,
gamma=2.,
num_offsets=72,
num_strips=72 - 1,
t_pos=15.,
t_neg=20.,
reduction='mean',
)
train = dict(
exp_name='resnet18_laneatt_culane',
workers=4,
batch_size=8,
checkpoint=None,
# Device args
# world_size=0,
# dist_url='env://',
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(360, 640),
original_size=(590, 1640),
num_classes=None,
num_epochs=15,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet18_laneatt_culane',
workers=4,
batch_size=80,
checkpoint='./checkpoints/resnet18_laneatt_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='LaneAtt',
backbone_channels=512,
backbone_os=32,
num_points=72,
img_w=640,
img_h=360,
topk_anchors=1000,
# https://github.com/lucastabelini/LaneATT/raw/main/data/culane_anchors_freq.pt
anchor_freq_path='culane_anchors_freq.pt',
anchor_feat_channels=64,
# nms config
conf_thres=0.5,
nms_thres=50,
nms_topk=4, # max # lanes of the dataset
# backbone config
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, False, False]
)
)

View File

@@ -0,0 +1,155 @@
# Data pipeline
# from configs.lane_detection.common.datasets.culane import dataset
# from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
# from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
# from configs.lane_detection.common.optims.matchingloss_polynomial import loss
# from configs.lane_detection.common.optims.adam000025 import optimizer
# from configs.lane_detection.common.optims.ep150_step import lr_scheduler
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=15,
)
from configs.lane_detection.common.datasets._utils import TUSIMPLE_ROOT
dataset = dict(
name='TuSimple',
image_set='train', # Only set for training. Testing will override this value by --state.
root=TUSIMPLE_ROOT,
padding_mask=False,
is_process=False,
)
optimizer = dict(
name='torch_optimizer',
torch_optim_class='Adam',
lr=0.0003
)
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomAffine',
degrees=(-6, 6),
translate=(25, 10),
scale=(0.85, 1.15),
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='LaneATTLabelFormat',
num_points=72,
image_size=(360, 640),
max_lanes=5
),
dict(
name='ToTensor' # div 255 ???
),
]
)
test_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ToTensor',
reverse_channels=True,
),
]
)
loss = dict(
name='LaneAttLoss',
cls_weight=10.,
reg_weight=1.,
alpha=0.25,
gamma=2.,
num_offsets=72,
num_strips=72 - 1,
t_pos=15.,
t_neg=20.,
reduction='mean'
)
train = dict(
exp_name='resnet18_laneatt_tusimple_1',
workers=4,
batch_size=8,
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=None,
num_epochs=100,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet18_laneatt_tusimple_1',
workers=4,
batch_size=32,
checkpoint='./checkpoints/resnet18_laneatt_tusimple_1/model_0100.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=10,
ppl=56,
thresh=None,
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='LaneAtt',
backbone_channels=512,
backbone_os=32,
num_points=72,
img_w=640,
img_h=360,
topk_anchors=1000,
# https://github.com/lucastabelini/LaneATT/raw/main/data/tusimple_anchors_freq.pt
anchor_freq_path='tusimple_anchors_freq.pt',
anchor_feat_channels=64,
# nms config
conf_thres=0.2,
nms_thres=45,
nms_topk=5, # max # lanes of the dataset
# backbone config
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, False, False]
)
)

View File

@@ -0,0 +1,153 @@
# Data pipeline
# from configs.lane_detection.common.datasets.culane import dataset
# from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
# from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
# from configs.lane_detection.common.optims.matchingloss_polynomial import loss
# from configs.lane_detection.common.optims.adam000025 import optimizer
# from configs.lane_detection.common.optims.ep150_step import lr_scheduler
lr_scheduler = dict(
name='CosineAnnealingLRWrapper',
epochs=15,
)
from configs.lane_detection.common.datasets._utils import CULANE_ROOT
dataset = dict(
name='CULane',
image_set='train', # Only set for training. Testing will override this value by --state.
root=CULANE_ROOT,
padding_mask=False,
is_process=False,
)
optimizer = dict(
name='torch_optimizer',
torch_optim_class='Adam',
lr=0.0003
)
train_augmentation = dict(
name='Compose',
transforms=[
dict(
name='RandomAffine',
degrees=(-6, 6),
translate=(25, 10),
scale=(0.85, 1.15),
),
dict(
name='RandomHorizontalFlip',
flip_prob=0.5
),
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='LaneATTLabelFormat',
num_points=72,
image_size=(360, 640),
max_lanes=4
),
dict(
name='ToTensor' # div 255 ???
),
]
)
test_augmentation = dict(
name='Compose',
transforms=[
dict(
name='Resize',
size_image=(360, 640),
size_label=(360, 640)
),
dict(
name='ToTensor'
),
]
)
loss = dict(
name='LaneAttLoss',
cls_weight=10.,
reg_weight=1.,
alpha=0.25,
gamma=2.,
num_offsets=72,
num_strips=72 - 1,
t_pos=15.,
t_neg=20.,
reduction='mean',
)
train = dict(
exp_name='resnet34_laneatt_culane',
workers=4,
batch_size=8,
checkpoint=None,
world_size=2,
dist_url='tcp://localhost:12345',
device='cuda',
val_num_steps=0, # Seg IoU validation (mostly useless)
save_dir='./checkpoints',
input_size=(360, 640),
original_size=(590, 1640),
num_classes=None,
num_epochs=15,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet34_laneatt_culane',
workers=4,
batch_size=80,
checkpoint='./checkpoints/resnet34_laneatt_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn=None, # 'dict_collate_fn' for LSTR
input_size=(360, 640),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='LaneAtt',
backbone_channels=512,
backbone_os=32,
num_points=72,
img_w=640,
img_h=360,
topk_anchors=1000,
# https://github.com/lucastabelini/LaneATT/raw/main/data/culane_anchors_freq.pt
anchor_freq_path='culane_anchors_freq.pt',
anchor_feat_channels=64,
# nms config
conf_thres=0.5,
nms_thres=50,
nms_topk=4, # max # lanes of the dataset
# backbone config
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet34',
return_layer='layer4',
pretrained=True,
replace_stride_with_dilation=[False, False, False]
)
)

View File

@@ -0,0 +1,79 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane import dataset
from configs.lane_detection.common.datasets.train_level0_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.matchingloss_polynomial import loss
from configs.lane_detection.common.optims.adam000025 import optimizer
from configs.lane_detection.common.optims.ep150_step import lr_scheduler
train = dict(
exp_name='resnet18s_lstr_culane',
workers=16,
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=(288, 800),
original_size=(590, 1640),
num_classes=None,
num_epochs=150,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet18s_lstr_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet18s_lstr_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='LSTR',
expansion=2,
num_queries=7,
aux_loss=True,
pos_type='sine',
drop_out=0.1,
num_heads=2,
enc_layers=2,
dec_layers=2,
pre_norm=False,
return_intermediate=True,
lsp_dim=8,
mlp_layers=3,
thresh=0.95,
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18_reduced',
return_layer='layer4',
pretrained=False,
replace_stride_with_dilation=[False, False, False],
expansion=2
)
)

View File

@@ -0,0 +1,79 @@
from importmagician import import_from
with import_from('./'):
# Data pipeline
from configs.lane_detection.common.datasets.culane import dataset
from configs.lane_detection.common.datasets.train_level1a_288 import train_augmentation
from configs.lane_detection.common.datasets.test_288 import test_augmentation
# Optimization pipeline
from configs.lane_detection.common.optims.matchingloss_polynomial import loss
from configs.lane_detection.common.optims.adam000025 import optimizer
from configs.lane_detection.common.optims.ep150_step import lr_scheduler
train = dict(
exp_name='resnet18s_lstr-aug_culane',
workers=16,
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=(288, 800),
original_size=(590, 1640),
num_classes=None,
num_epochs=150,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
seg=False, # Seg-based method or not
)
test = dict(
exp_name='resnet18s_lstr-aug_culane',
workers=10,
batch_size=80,
checkpoint='./checkpoints/resnet18s_lstr-aug_culane/model.pt',
# Device args
device='cuda',
save_dir='./checkpoints',
seg=False,
gap=20,
ppl=18,
thresh=None,
collate_fn='dict_collate_fn', # 'dict_collate_fn' for LSTR
input_size=(288, 800),
original_size=(590, 1640),
max_lane=4,
dataset_name='culane'
)
model = dict(
name='LSTR',
expansion=2,
num_queries=7,
aux_loss=True,
pos_type='sine',
drop_out=0.1,
num_heads=2,
enc_layers=2,
dec_layers=2,
pre_norm=False,
return_intermediate=True,
lsp_dim=8,
mlp_layers=3,
thresh=0.95,
backbone_cfg=dict(
name='predefined_resnet_backbone',
backbone_name='resnet18_reduced',
return_layer='layer4',
pretrained=False,
replace_stride_with_dilation=[False, False, False],
expansion=2
)
)

Some files were not shown because too many files have changed in this diff Show More