**LSTR**: Lane Shape Prediction with Transformers
=======
![LSTR](.github/logo.png)
* ðEnd-to-end architecture: Directly output lane shape parameters.
* â¡Super lightweight: The number of model parameters is only 765,787.
* â¡Super low complexity: The number of MACs (1 MAC = 2 FLOP) is only 574.280M.
* ðTraining friendly: Lower GPU memory cost. Input (360, 640, 3) with batch_size 16 uses 1245MiB GPU usages.
PyTorch(1.5.0) training, evaluating and pretrained models for LSTR (Lane Shape Prediction with Transformers).
We streamline the lane detection to a single-stage framework by proposing a novel lane shape model that achieves 96.18
TuSimple accuracy.
For details see [End-to-end Lane Shape Prediction with Transformers](https://arxiv.org/pdf/2011.04233.pdf) by Ruijin Liu, Zejian Yuan, Tie Liu, Zhiliang Xiong.
## Updates!!
* ã2021/12/03ã:fire: Our new work Learning to Predict 3D Lane Shape and Camera Pose from a Single Image via Geometry Constraints by Ruijin Liu, Dapeng Chen, Tie Liu, Zhiliang Xiong, Zejian Yuan is accepted by AAAI2022! The preprint paper and codes will be released soon!
* ã2021/11/23ã We now support [Train and Test Custom Data](https://github.com/liuruijin17/LSTR/tree/custom).
Tutorial: [Train and Test Your Custom Data](https://github.com/liuruijin17/LSTR/blob/custom/docs/train_test_custom_data.md).
* ã2021/11/16ã We fix the [Multi-GPU Training](https://github.com/liuruijin17/LSTR/tree/multiGPU).
* ã2020/12/06ã We now support [CULane Dataset](https://github.com/liuruijin17/LSTR/tree/culane).
## Comming soon
- [ ] LSTR-nano(New backbone): 96.33 TuSimple accuracy with only 40% MACs (229.419M) and 40% #Params (302,546) of LSTR.
- [ ] Mosaic Augmentation.
- [ ] Loguru based logger module.
- [ ] Geometry based loss functions.
- [ ] Segmentation prior.
## Model Zoo
We provide the baseline LSTR model file (trained on TuSimple train and val sets after 500000 iterations) in
the ./cache/nnet/LSTR/LSTR_500000.pkl (~3.1MB).
## Data Preparation
Download and extract TuSimple train, val and test with annotations from [TuSimple](https://github.com/TuSimple/tusimple-benchmark).
We expect the directory structure to be the following:
```
TuSimple/
LaneDetection/
clips/
label_data_0313.json
label_data_0531.json
label_data_0601.json
test_label.json
LSTR/
```
## Set Envirionment
* Linux ubuntu 16.04
```
conda env create --name lstr --file environment.txt
```
After you create the environment, activate it
```
conda activate lstr
```
Then
```
pip install -r requirements.txt
```
## Training and Evaluation
To train a model:
(if you only want to use the train set, please see ./config/LSTR.json and
set "train_split": "train")
```
python train.py LSTR
```
* Visualized images are in ./results during training.
* Saved model files (every 5000 iterations) are in ./cache during training.
To train a model from a snapshot model file:
```
python train.py LSTR --iter 500000
```
To evaluate (GPU 603MiB usage when evaluating single image iteratively), then you will see the paper's result:
```
python test.py LSTR --testiter 500000 --modality eval --split testing
```
To evaluate FPS (set --batch to maximum the FPS, GPU 877MiB usage if you repeat each image 16 times):
```
python test.py LSTR --testiter 500000 --modality eval --split testing --batch 16
```
To evaluate and save detected images in ./results/LSTR/500000/testing/lane_debug:
```
python test.py LSTR --testiter 500000 --modality eval --split testing --debug
```
* Demo (displayed parameters are rounded to three significant figures.)
![Demo](.github/0601_1494453331677390055_20_resize.jpg)
To evaluate and save decoder attention maps (store --debugEnc to visualize encoder attention maps):
```
python test.py LSTR --testiter 500000 --modality eval --split testing --debug --debugDec
```
To evaluate on a set of images (store your images in ./images, then the detected results will be saved in ./detections):
```
python test.py LSTR --testiter 500000 --modality images --image_root ./ --debug
```
## Citation
```
@InProceedings{LSTR,
author = {Ruijin Liu and Zejian Yuan and Tie Liu and Zhiliang Xiong},
title = {End-to-end Lane Shape Prediction with Transformers},
booktitle = {WACV},
year = {2021}
}
```
## License
LSTR is released under BSD 3-Clause License. Please see [LICENSE](LICENSE) file for more information.
## Contributing
We actively welcome your pull requests!
## Acknowledgements
[DETR](https://github.com/facebookresearch/detr)
[PolyLaneNet](https://github.com/lucastabelini/PolyLaneNet)
[CornerNet](https://github.com/princeton-vl/CornerNet)
没有合适的资源?快使用搜索试试~ 我知道了~
端到端的多车道线检测#车道线检测
共76个文件
py:37个
pyc:31个
txt:2个
1 下载量 165 浏览量
2022-10-19
20:35:38
上传
评论
收藏 3.02MB ZIP 举报
温馨提示
端到端的多车道线检测#车道线检测LSTR #LSTR(带变压器的车道形状预测)的培训、评估和预处理模型。我们通过提出一种新的车道形状模型,实现96.18 TuSimple精度,从而将车道检测简化为单阶段框架#私信获得代码讲解
资源详情
资源评论
资源推荐
收起资源包目录
LSTR-main.zip (76个子文件)
LSTR-main
models
py_utils
matcher.py 4KB
data_parallel.py 5KB
__pycache__
kp.cpython-38.pyc 10KB
scatter_gather.cpython-38.pyc 2KB
__init__.cpython-38.pyc 177B
data_parallel.cpython-38.pyc 4KB
detr_loss.cpython-38.pyc 8KB
matcher.cpython-38.pyc 4KB
misc.cpython-38.pyc 13KB
transformer.cpython-38.pyc 9KB
position_encoding.cpython-38.pyc 3KB
detr_loss.py 9KB
misc.py 13KB
scatter_gather.py 1KB
__init__.py 26B
position_encoding.py 3KB
kp.py 12KB
transformer.py 12KB
__pycache__
__init__.cpython-38.pyc 133B
LSTR.cpython-38.pyc 4KB
__init__.py 12B
LSTR.py 6KB
config
LSTR.json 1KB
cache
nnet
LSTR
LSTR_500000.pkl 3.03MB
test.py 4KB
db
__pycache__
tusimple.cpython-38.pyc 14KB
__init__.cpython-38.pyc 129B
datasets.cpython-38.pyc 202B
detection.cpython-38.pyc 2KB
base.cpython-38.pyc 3KB
datasets.py 75B
__init__.py 12B
tusimple.py 17KB
utils
metric.py 6KB
__pycache__
evaluator.cpython-38.pyc 1KB
__init__.cpython-38.pyc 135B
metric.cpython-38.pyc 6KB
lane.cpython-38.pyc 5KB
evaluator.py 1KB
__init__.py 13B
upperbound.py 1KB
plot_log.py 6KB
lane.py 5KB
gen_video.py 2KB
base.py 2KB
detection.py 2KB
.github
0601_1494453331677390055_20_resize.jpg 108KB
logo.png 53KB
train.py 9KB
test
__pycache__
tusimple.cpython-38.pyc 6KB
__init__.cpython-38.pyc 131B
__init__.py 12B
tusimple.py 10KB
images.py 5KB
sample
vis.py 5KB
__pycache__
tusimple.cpython-38.pyc 2KB
__init__.cpython-38.pyc 133B
vis.cpython-38.pyc 3KB
__init__.py 12B
tusimple.py 3KB
__pycache__
config.cpython-38.pyc 9KB
nnet
__pycache__
__init__.cpython-38.pyc 131B
py_factory.cpython-38.pyc 6KB
__init__.py 12B
py_factory.py 6KB
LICENSE 1KB
requirements.txt 1KB
config.py 8KB
README.md 5KB
utils
__pycache__
__init__.cpython-38.pyc 325B
tqdm.cpython-38.pyc 985B
image.cpython-38.pyc 3KB
tqdm.py 545B
__init__.py 144B
image.py 2KB
environment.txt 762B
共 76 条
- 1
阿利同学
- 粉丝: 3w+
- 资源: 290
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0