# Ultra-Fast-Lane-Detection-V2
PyTorch implementation of the paper "[Ultra Fast Deep Lane Detection with Hybrid Anchor Driven Ordinal Classification](https://arxiv.org/abs/2206.07389)".
![](ufldv2.png "vis")
# Demo
<a href="https://youtu.be/VkvpoHlaMe0
" target="_blank"><img src="http://img.youtube.com/vi/VkvpoHlaMe0/0.jpg"
alt="Demo" width="240" height="180" border="10" /></a>
# Install
Please see [INSTALL.md](./INSTALL.md)
# Get started
Please modify the `data_root` in any configs you would like to run. We will use `configs/culane_res18.py` as an example.
To train the model, you can run:
```
python train.py configs/culane_res18.py --log_path /path/to/your/work/dir
```
or
```
python -m torch.distributed.launch --nproc_per_node=8 train.py configs/culane_res18.py --log_path /path/to/your/work/dir
```
It should be noted that if you use different number of GPUs, the learning rate should be adjusted accordingly. The configs' learning rates correspond to 8-GPU training on CULane and CurveLanes datasets. **If you want to train on CULane or CurveLanes with single GPU, please decrease the learning rate by a factor of 1/8.** On the Tusimple, the learning rate corresponds to single GPU training.
# Trained models
We provide trained models on CULane, Tusimple, and CurveLanes.
| Dataset | Backbone | F1 | Link |
|------------|----------|-------|------|
| CULane | ResNet18 | 75.0 | [Google](https://drive.google.com/file/d/1oEjJraFr-3lxhX_OXduAGFWalWa6Xh3W/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1Z3W4y3eA9xrXJ51-voK4WQ?pwd=pdzs) |
| CULane | ResNet34 | 76.0 | [Google](https://drive.google.com/file/d/1AjnvAD3qmqt_dGPveZJsLZ1bOyWv62Yj/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1PHNpVHboQlmpjM5NXl9IxQ?pwd=jw8f) |
| Tusimple | ResNet18 | 96.11 | [Google](https://drive.google.com/file/d/1Clnj9-dLz81S3wXiYtlkc4HVusCb978t/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1umHo0RZIAQ1l_FzL2aZomw?pwd=6xs1) |
| Tusimple | ResNet34 | 96.24 | [Google](https://drive.google.com/file/d/1pkz8homK433z39uStGK3ZWkDXrnBAMmX/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1Eq7oxnDoE0vcQGzs1VsGZQ?pwd=b88p) |
| CurveLanes | ResNet18 | 80.42 | [Google](https://drive.google.com/file/d/1VfbUvorKKMG4tUePNbLYPp63axgd-8BX/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1jCqKqgSQdh6nwC5pYpYO1A?pwd=urhe) |
| CurveLanes | ResNet34 | 81.34 | [Google](https://drive.google.com/file/d/1O1kPSr85Icl2JbwV3RBlxWZYhLEHo8EN/view?usp=sharing)/[Baidu](https://pan.baidu.com/s/1fk2Wg-1QoHXTnTlasSM6uQ?pwd=4mn3) |
For evaluation, run
```Shell
mkdir tmp
python test.py configs/culane_res18.py --test_model /path/to/your/model.pth --test_work_dir ./tmp
```
Same as training, multi-gpu evaluation is also supported.
```Shell
mkdir tmp
python -m torch.distributed.launch --nproc_per_node=8 test.py configs/culane_res18.py --test_model /path/to/your/model.pth --test_work_dir ./tmp
```
# Visualization
We provide a script to visualize the detection results. Run the following commands to visualize on the testing set of CULane.
```
python demo.py configs/culane_res18.py --test_model /path/to/your/culane_res18.pth
```
# Tensorrt Deploy
We also provide a python script to do tensorrt inference on videos.
1. Convert to onnx model
```
python deploy/pt2onnx.py --config_path configs/culane_res34.py --model_path weights/culane_res34.pth
```
Or you can download the onnx model using the following script: https://github.com/PINTO0309/PINTO_model_zoo/blob/main/324_Ultra-Fast-Lane-Detection-v2/download.sh. And copy `ufldv2_culane_res34_320x1600.onnx` to `weights/ufldv2_culane_res34_320x1600.onnx`
2. Convert to tensorrt model
Use trtexec to convert engine model
`trtexec --onnx=weights/culane_res34.onnx --saveEngine=weights/culane_res34.engine`
3. Do inference
```
python deploy/trt_infer.py --config_path configs/culane_res34.py --engine_path weights/culane_res34.engine --video_path example.mp4
```
# Citation
```BibTeX
@InProceedings{qin2020ultra,
author = {Qin, Zequn and Wang, Huanyu and Li, Xi},
title = {Ultra Fast Structure-aware Deep Lane Detection},
booktitle = {The European Conference on Computer Vision (ECCV)},
year = {2020}
}
@ARTICLE{qin2022ultrav2,
author={Qin, Zequn and Zhang, Pengyi and Li, Xi},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
title={Ultra Fast Deep Lane Detection With Hybrid Anchor Driven Ordinal Classification},
year={2022},
volume={},
number={},
pages={1-14},
doi={10.1109/TPAMI.2022.3182097}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Ultra-Fast-Lane-Detection-v2 pytorch版 Ultra-Fast-Lane-Detection-v2官方原版数据加载用的nvidia.dali.pipeline Windows没有nvidia库,所以无法训练,数据增强也不方便,特地实现了pytorch的dataset版,可以训练,推理预测 训练收敛更快 可以在这个基础上改进,很方便。
资源推荐
资源详情
资源评论
收起资源包目录
Ultra-Fast-Lane-Detection-v2 pytorch版 (101个子文件)
getopt.c 1KB
evaluate.cpp 8KB
spline.cpp 5KB
counter.cpp 3KB
lane_compare.cpp 2KB
my_interp_cuda.cpp 874B
my_interp_cuda_kernel.cu 3KB
.gitignore 102B
.gitignore 50B
getopt.h 939B
hungarianGraph.hpp 2KB
counter.hpp 1KB
lane_compare.hpp 800B
spline.hpp 567B
Ultra-Fast-Lane-Detection-v2-master.iml 500B
LICENSE 1KB
calTotal.m 427B
Makefile 2KB
LICENSE.md 11KB
README.md 4KB
INSTALL.md 4KB
example.mp4 24.1MB
ufldv2.png 126KB
eval_wrapper.py 47KB
dataset.py 21KB
dali_data.py 14KB
common.py 12KB
config.py 12KB
convert_tusimple.py 8KB
loss.py 8KB
factory.py 7KB
convert_curvelanes.py 7KB
train.py 6KB
trt_infer.py 6KB
dataloader.py 5KB
mytransforms.py 5KB
demo_o.py 5KB
model_culane.py 5KB
demo.py 5KB
dist_utils.py 5KB
metrics.py 4KB
demo_video.py 4KB
lane2.py 4KB
model_curvelanes.py 4KB
layer.py 4KB
lane.py 4KB
qt2.py 4KB
pt2onnx.py 3KB
seg_model.py 3KB
make_curvelane_as_culane_test.py 2KB
test.py 2KB
backbone.py 2KB
cache_culane_ponits.py 2KB
constant.py 1KB
test.py 1KB
json_2_alone.py 1KB
view_label.py 968B
tusimple_res18.py 723B
tusimple_res34.py 703B
speed_simple.py 646B
culane_res34.py 613B
culane_res18.py 612B
curvelanes_res18.py 557B
model_tusimple.py 426B
setup.py 333B
__init__.py 80B
eval_wrapper.cpython-310.pyc 25KB
config.cpython-310.pyc 11KB
dali_data.cpython-310.pyc 10KB
dataset.cpython-310.pyc 9KB
common.cpython-310.pyc 9KB
loss.cpython-310.pyc 8KB
convert_tusimple.cpython-310.pyc 6KB
mytransforms.cpython-310.pyc 6KB
factory.cpython-310.pyc 5KB
metrics.cpython-310.pyc 5KB
dist_utils.cpython-310.pyc 5KB
lane2.cpython-310.pyc 4KB
layer.cpython-310.pyc 4KB
dataloader.cpython-310.pyc 4KB
demo.cpython-310.pyc 4KB
model_culane.cpython-310.pyc 4KB
model_curvelanes.cpython-310.pyc 3KB
seg_model.cpython-310.pyc 2KB
backbone.cpython-310.pyc 2KB
constant.cpython-310.pyc 993B
model_tusimple.cpython-310.pyc 649B
__init__.cpython-310.pyc 245B
my_interp.cp310-win_amd64.pyd 242KB
run-full.sh 2KB
run-lite.sh 363B
build.sh 82B
CMakeLists.txt 2KB
train_gt.txt 367B
readme.txt 180B
requirements.txt 71B
workspace.xml 15KB
Project_Default.xml 8KB
modules.xml 329B
misc.xml 203B
共 101 条
- 1
- 2
资源评论
- xiaomi2132112024-05-01资源内容总结的很到位,内容详实,很受用,学到了~
- ly壹亿壹壹2024-04-05果断支持这个资源,资源解决了当前遇到的问题,给了新的灵感,感谢分享~AI视觉网奇2024-04-25感谢您的认可,大家的认可,是我前进的功力,还有朋友想下载的,私信我,6折优惠
- m0_496199672023-11-13资源很好用,有较大的参考价值,资源不错,支持一下。AI视觉网奇2024-04-25感谢您的认可,大家的认可,是我前进的动力,再有朋友想下载的,私信我,6折优惠
AI视觉网奇
- 粉丝: 7w+
- 资源: 94
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功