Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
cc 4a2f39690c | 1 year ago | |
---|---|---|
.. | ||
configs | 2 years ago | |
core | 1 year ago | |
data | 2 years ago | |
datasets | 2 years ago | |
deploy | 2 years ago | |
losses | 2 years ago | |
third_party | 2 years ago | |
transforms | 2 years ago | |
README.md | 1 year ago | |
README_CN.md | 1 year ago | |
export.py | 1 year ago | |
predict.py | 1 year ago | |
train.py | 1 year ago | |
val.py | 1 year ago |
English | 简体中文
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 PaddleSeg for lane detection.
Versions
PaddlePaddle >= 2.0.2
Python >= 3.7+
Due to the high computational cost of model, PaddleSeg is recommended for GPU version PaddlePaddle. CUDA 10.0 or later is recommended. See PaddlePaddle official website for the installation tutorial.
git clone https://github.com/PaddlePaddle/PaddleSeg
cd PaddleSeg/contrib/LaneSeg
pip install scikit-learn
pip install opencv-python
pip install scikit-image
pip install paddleseg==2.5.0
The evaluation is base on TuSimple challenge evaluation method. You can get more information from TuSimple example
Lane detection model performance on Tusimple.
Method | Acc | FN | FP | Link |
---|---|---|---|---|
BiseNetV2 | 96.38% | 0.04545 | 0.03363 | model |
FastScnn | 96.04% | 0.04909 | 0.04058 | model |
Note: The model input size is (640, 368) and the GPU is Tesla V100 32G.
Using Tusimple's open source Tusimple dataset as our demo dataset for the tutorial. Baidu Yun download, 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.
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:
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
...
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.
python train.py --help
If you want to use multiple GPUs,please use python -m paddle.distributed.launch
to run.
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.
python val.py --help
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.
python predict.py --help
prediction:
pseudo_color_prediction:
added_prediction:
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.
python export.py --help
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.
python deploy/python/infer.py --help
reference Paddle Inference tutorial
the C++ sources files of the project is in LaneSeg/deploy/cpp
飞桨高性能图像分割开发套件,端到端完成从训练到部署的全流程图像分割应用。
https://github.com/PaddlePaddle/PaddleSeg
Python Markdown Text Shell Java other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》