English | [简体中文](README_CN.md)
# LaneSeg
Lane detection is a category of automatic driving algorithms, which can be used to assist vehicle positioning and decision-making. In the early days, there were lane detection methods based on traditional image processing, but with the evolution of technology, the scenes that lane detection tasks deal with are more and more diversified, and more methods are currently seeking to detect the location of lane semantically. This project mainly uses pdseg for lane detection.
## Contents
- [Installation](#Installation)
- [Models](#Models)
- [Dataset Preparation](#Dataset-Preparation)
- [Training, Evaluation and Prediction](#Training-Evaluation-and-Prediction)
- [Export and Deploy](#Export-and-Deploy)
## Installation
#### 1. Install PaddlePaddle
Versions
* PaddlePaddle >= 2.0.2
* Python >= 3.7+
Due to the high computational cost of model, pdseg is recommended for GPU version PaddlePaddle. CUDA 10.0 or later is recommended. See [PaddlePaddle official website](https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html) for the installation tutorial.
#### 2. Download the pdseg repository
```shell
git clone https://github.com/PaddlePaddle/pdseg
```
#### 3. Installation
```shell
cd pdseg
pip install scikit-learn
pip install opencv-python
pip install scikit-image
pip install -e .
cd contrib/LaneSeg
```
## Models
The evaluation is base on TuSimple challenge evaluation method. You can get more information from [TuSimple example](https://github.com/TuSimple/tusimple-benchmark/blob/master/example/lane_demo.ipynb)
Lane detection model performance on Tusimple.
| Method | Acc | FN | FP | Link|
|-|-|-|-|-|
|BiseNetV2|96.38%|0.04545|0.03363|[model](https://pdseg.bj.bcebos.com/lane_seg/bisenet/model.pdparams)|
|FastScnn|96.04% |0.04909|0.04058|[model](https://pdseg.bj.bcebos.com/lane_seg/fastscnn/model.pdparams)|
Note: The model input size is (640, 368) and the GPU is Tesla V100 32G.
## Dataset preparation
Using Tusimple's open source [Tusimple](https://github.com/TuSimple/tusimple-benchmark/issues/3) dataset as our demo dataset for the tutorial. Baidu Yun [download](https://pan.baidu.com/s/1RuDUne5CpaNxVLVLmpEg-w), code: 9568. we should download train_set.zip, test_set.zip, test_label.json, and unzip train_set.zip,test_set.zip to `data/tusimple` directory, meanwhile, we should place test_label.json to `test_set` directory.
```shell
cd data
mkdir tusimple && cd tusimple
unzip -d train_set train_set.zip
unzip -d test_set test_set.zip
cd ../../
```
The folder structure is as follow:
```
LaneSeg
|-- data
|-- tusimple
|-- train_set
|-- clips
|-- 0313-1
|-- 0313-2
|-- 0531
|-- 0601
|-- label_data_0313.json
|-- label_data_0531.json
|-- label_data_0601.json
|-- test_set
|-- clips
|-- 0530
|-- 0531
|-- 0601
|-- test_tasks_0627.json
|-- test_label.json
```
Run the following command:
```shell
python third_party/generate_tusimple_dataset.py --root data/tusimple
```
Organize the dataset into the following structure and place the dataset under the `data` directory.
```
The folder structure is as follow:
LaneSeg
|-- data
|-- tusimple
|-- train_set
...
|-- labels
|-- 0313-1
|-- 0313-2
|-- 0531
|-- 0601
|-- train_list.txt
|-- test_set
...
|-- labels
|-- 0530
|-- 0531
|-- 0601
|-- train_list.txt
```
The contents of train_list.txt is as follows:
```
/train_set/clips/0313-1/6040/20.jpg /train_set/labels/0313-1/6040/20.png
/train_set/clips/0313-1/5320/20.jpg /train_set/labels/0313-1/5320/20.png
/train_set/clips/0313-1/23700/20.jpg /train_set/labels/0313-1/23700/20.png
...
```
The contents of test_list.txt is as follows:
```
/test_set/clips/0530/1492626760788443246_0/20.jpg /test_set/labels/0530/1492626760788443246_0/20.png
/test_set/clips/0530/1492627171538356342_0/20.jpg /test_set/labels/0530/1492627171538356342_0/20.png
/test_set/clips/0530/1492627288467128445_0/20.jpg /test_set/labels/0530/1492627288467128445_0/20.png
...
```
## Training, Evaluation and Prediction
### Training
```shell
export CUDA_VISIBLE_DEVICES=0
python train.py \
--config configs/bisenetV2_tusimple_640x368_300k.yml \
--do_eval \
--use_vdl \
--save_interval 2000 \
--num_workers 5 \
--save_dir output
```
**note:** Using `--do_eval` will affect training speed and increase memory consumption, turning on and off according to needs.
`--num_workers` Read data in multi-process mode. Speed up data preprocessing.
Run the following command to view more parameters.
```shell
python train.py --help
```
If you want to use multiple GPUs,please use `python -m paddle.distributed.launch` to run.
### Evaluation
```shell
export CUDA_VISIBLE_DEVICES=0
python val.py \
--config configs/bisenetV2_tusimple_640x368_300k.yml \
--model_path output/best_model/model.pdparams \
--save_dir ./output/results \
--is_view True
```
`--is_view` The prediction results will be saved if turn on. If it is off, it will speed up the evaluation.
You can directly download the provided model for evaluation.
Run the following command to view more parameters.
```shell
python val.py --help
```
### Prediction
```shell
export CUDA_VISIBLE_DEVICES=0
python predict.py \
--config configs/bisenetV2_tusimple_640x368_300k.yml \
--model_path output/best_model/model.pdparams \
--image_path data/test_images/3.jpg \
--save_dir ./output/results
```
You can directly download the provided model for evaluation.
Run the following command to view more parameters.
```shell
python predict.py --help
```
prediction:<br/>
![](data/images/points/3.jpg)<br/>
pseudo_color_prediction:<br/>
![](data/images/pseudo_color_prediction/3.png)<br/>
added_prediction:<br/>
![](data/images/added_prediction/3.jpg)
## Export and Deploy
### Model Export
```shell
python export.py \
--config configs/bisenetV2_tusimple_640x368_300k.yml \
--model_path output/best_model/model.pdparams \
--save_dir output/export
```
Run the following command to view more parameters.
```shell
python export.py --help
```
### Deploy
#### Paddle Inference (python)
```shell
python deploy/python/infer.py \
--config output/export/deploy.yaml \
--image_path data/test_images/3.jpg \
--save_dir ouput/results
```
Run the following command to view more parameters.
```shell
python deploy/python/infer.py --help
```
#### Paddle Inference(C++)
reference [Paddle Inference tutorial](./deploy/cpp/README.md)
the C++ sources files of the project is in LaneSeg/deploy/cpp
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
paddleseg_2.5.0_以后的版本不再支持车道线检测模型的训练,_此仓库用于自定义数据集训练_LaneSeg.zip (159个子文件)
README.md 7KB
README_CN.md 6KB
transforms.py 45KB
pointrend.py 35KB
hrnet.py 28KB
swin_transformer.py 27KB
enet.py 21KB
mix_transformer.py 18KB
espnet.py 17KB
u2net.py 17KB
setr.py 16KB
config.py 16KB
ann.py 15KB
train.py 14KB
ddrnet.py 14KB
unet_3plus.py 14KB
xception_deeplab.py 14KB
gscnn.py 13KB
resnet_vd.py 13KB
train.py 13KB
vision_transformer.py 12KB
mobilenetv3.py 12KB
fast_scnn.py 11KB
infer.py 11KB
val.py 11KB
hardnet.py 11KB
stdcnet.py 10KB
deeplab.py 10KB
pp_liteseg.py 10KB
ginet.py 10KB
layer_libs.py 10KB
bisenet.py 10KB
rmi_loss.py 10KB
espnetv1.py 10KB
attention.py 9KB
ocrnet.py 9KB
decoupled_segnet.py 9KB
cross_entropy_loss.py 9KB
segmenter.py 9KB
dnlnet.py 9KB
callbacks.py 9KB
sfnet.py 8KB
metrics.py 8KB
unet_plusplus.py 8KB
fastfcn.py 8KB
emanet.py 8KB
binary_cross_entropy_loss.py 8KB
progbar.py 8KB
stdcseg.py 8KB
bisenetv1.py 8KB
pixel_contrast_cross_entropy_loss.py 8KB
gcnet.py 8KB
encnet.py 8KB
pfpnnet.py 8KB
pphumanseg_lite.py 8KB
isanet.py 8KB
lovasz_loss.py 8KB
tensor_fusion.py 7KB
mla_transformer.py 7KB
semantic_connectivity_loss.py 7KB
portraitnet.py 7KB
danet.py 7KB
glore.py 7KB
ccnet.py 7KB
pyramid_pool.py 7KB
utils.py 7KB
dataset.py 6KB
point_cross_entropy_loss.py 6KB
attention_unet.py 6KB
infer.py 6KB
train.py 6KB
pspnet.py 6KB
predict.py 6KB
get_lane_coords.py 6KB
nonlocal2d.py 6KB
mobilenetv2.py 6KB
detail_aggregate_loss.py 6KB
segformer.py 5KB
download.py 5KB
dmnet.py 5KB
functional.py 5KB
supervisely.py 5KB
lane_transforms.py 5KB
segnet.py 5KB
decoupledsegnet_relax_boundary_loss.py 5KB
eg1800.py 5KB
gscnn_dual_task_loss.py 5KB
fcn.py 5KB
unet.py 5KB
tusimple.py 5KB
lane.py 5KB
voc.py 5KB
focal_loss.py 5KB
visualize.py 5KB
manager.py 5KB
tusimple_processor.py 5KB
ohem_edge_attention_loss.py 5KB
hrnet_contrast.py 5KB
generate_tusimple_dataset.py 4KB
predict.py 4KB
共 159 条
- 1
- 2
资源评论
2401_87496566
- 粉丝: 1077
- 资源: 5282
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于HiEasyX库的学习工具系统.zip
- (源码)基于JSP+Servlet+JDBC的学生宿舍管理系统.zip
- (源码)基于Arduino和Raspberry Pi的自动化花园系统.zip
- (源码)基于JSP和Servlet的数据库管理系统.zip
- (源码)基于Python的文本相似度计算系统.zip
- (源码)基于Spring Boot和Redis的高并发秒杀系统.zip
- (源码)基于Java的Web汽车销售管理系统.zip
- (源码)基于Python的智能家居系统.zip
- (源码)基于Python和CPM模型的中文文本生成系统.zip
- (源码)基于Java Swing和MySQL的教务管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功