# LaneNet-Lane-Detection
The main network architecture is as follows:
`Network Architecture`
![NetWork_Architecture](./data/source_image/network_architecture.png)
## Installation
This software has only been tested on ubuntu 16.04(x64), python3.5, cuda-9.0, cudnn-7.0 with a GTX-1070 GPU.
To install this software you need tensorflow 1.12.0 and other version of tensorflow has not been tested but I think
it will be able to work properly in tensorflow above version 1.12. Other required package you may install them by
```
pip3 install -r requirements.txt
```
## Test model
In this repo I uploaded a model trained on tusimple lane dataset [Tusimple_Lane_Detection](http://benchmark.tusimple.ai/#/).
The deep neural network inference part can achieve around a 50fps which is similar to the description in the paper. But
the input pipeline I implemented now need to be improved to achieve a real time lane detection system.
The trained lanenet model weights files are stored in
[lanenet_pretrained_model](https://www.dropbox.com/sh/0b6r0ljqi76kyg9/AADedYWO3bnx4PhK1BmbJkJKa?dl=0). You can
download the model and put them in folder weights/tusimple_lanenet/
You may also download the pretrained model via [BaiduNetDisk here](https://pan.baidu.com/s/1sLLSE1CWksKNxmRIGaQn_A) and
extract code is `86sd`.
You can test a single image on the trained model as follows
```
python tools/test_lanenet.py --weights_path /PATH/TO/YOUR/CKPT_FILE_PATH
--image_path ./data/tusimple_test_image/0.jpg
```
The results are as follows:
`Test Input Image`
![Test Input](./data/tusimple_test_image/0.jpg)
`Test Lane Mask Image`
![Test Lane_Mask](./data/source_image/lanenet_mask_result.png)
`Test Lane Binary Segmentation Image`
![Test Lane_Binary_Seg](./data/source_image/lanenet_binary_seg.png)
`Test Lane Instance Segmentation Image`
![Test Lane_Instance_Seg](./data/source_image/lanenet_instance_seg.png)
If you want to evaluate the model on the whole tusimple test dataset you may call
```
python tools/evaluate_lanenet_on_tusimple.py
--image_dir ROOT_DIR/TUSIMPLE_DATASET/test_set/clips
--weights_path /PATH/TO/YOUR/CKPT_FILE_PATH
--save_dir ROOT_DIR/TUSIMPLE_DATASET/test_set/test_output
```
If you set the save_dir argument the result will be saved in that folder
or the result will not be saved but be
displayed during the inference process holding on 3 seconds per image.
I test the model on the whole tusimple lane
detection dataset and make it a video. You may catch a glimpse of it bellow.
`Tusimple test dataset gif`
![tusimple_batch_test_gif](./data/source_image/lanenet_batch_test.gif)
## Train your own model
#### Data Preparation
Firstly you need to organize your training data refer to the data/training_data_example folder structure. And you need
to generate a train.txt and a val.txt to record the data used for training the model.
The training samples consist of three components, a binary segmentation label file, a instance segmentation label
file and the original image. The binary segmentation uses 255 to represent the lane field and 0 for the rest. The
instance use different pixel value to represent different lane field and 0 for the rest.
All your training image will be scaled into the same scale according to the config file.
Use the script here to generate the tensorflow records file
```
python tools/make_tusimple_tfrecords.py
```
#### Train model
In my experiment the training epochs are 80010, batch size is 4, initialized learning rate is 0.001 and use polynomial
decay with power 0.9. About training parameters you can check the global_configuration/config.py for details.
You can switch --net argument to change the base encoder stage. If you choose --net vgg then the vgg16 will be used as
the base encoder stage and a pretrained parameters will be loaded. And you can modified the training
script to load your own pretrained parameters or you can implement your own base encoder stage.
You may call the following script to train your own model
```
python tools/train_lanenet_tusimple.py
```
You may monitor the training process using tensorboard tools
During my experiment the `Total loss` drops as follows:
![Training loss](./data/source_image/total_loss.png)
The `Binary Segmentation loss` drops as follows:
![Training binary_seg_loss](./data/source_image/binary_seg_loss.png)
The `Instance Segmentation loss` drops as follows:
![Training instance_seg_loss](./data/source_image/instance_seg_loss.png)
## Experiment
The accuracy during training process rises as follows:
![Training accuracy](./data/source_image/accuracy.png)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
车道线检测_基于lanenet实现的实时车道线检测_优质项目实战.zip (81个子文件)
车道线检测_基于lanenet实现的实时车道线检测_优质项目实战
tools
test_lanenet.py 5KB
evaluate_lanenet_on_tusimple.py 4KB
make_tusimple_tfrecords.py 703B
generate_tusimple_dataset.py 6KB
train_lanenet_tusimple.py 1KB
evaluate_model_utils.py 2KB
lanenet_model
__init__.py 241B
lanenet.py 3KB
lanenet_back_end.py 8KB
lanenet_front_end.py 1KB
lanenet_discriminative_loss.py 5KB
lanenet_postprocess.py 15KB
_config.yml 26B
semantic_segmentation_zoo
__init__.py 219B
cnn_basenet.py 18KB
bisenet_v2.py 40KB
vgg16_based_fcn.py 14KB
data
source_image
lanenet_instance_seg.png 3KB
lanenet_mask_result.png 1.34MB
sam_clip_seg.png 2MB
lanenet_binary_seg.png 2KB
lanenet_embedding.png 628KB
instance_seg_loss.png 45KB
black_mask.png 417KB
black_mask_after_adjust.png 420KB
binary_seg_loss.png 46KB
qr.jpg 172KB
accuracy.png 47KB
lanenet_batch_test.gif 38.79MB
network_architecture.png 174KB
total_loss.png 43KB
mortred_model_server.png 214KB
tusimple_test_image
2.jpg 168KB
1.jpg 203KB
0.jpg 256KB
3.jpg 234KB
tusimple_ipm_remap.yml 14.02MB
training_data_example
image
0000.png 1.06MB
0003.png 1.14MB
0001.png 1.08MB
0002.png 1.15MB
0005.png 1.04MB
0004.png 1.11MB
val.txt 493B
gt_instance_image
0000.png 7KB
0003.png 8KB
0001.png 7KB
0002.png 8KB
0005.png 7KB
0004.png 7KB
gt_binary_image
0000.png 7KB
0003.png 7KB
0001.png 7KB
0002.png 8KB
0005.png 6KB
0004.png 6KB
train.txt 988B
.idea
vcs.xml 180B
local_utils
config_utils
__init__.py 222B
parse_config_utils.py 7KB
log_util
__init__.py 247B
init_logger.py 1KB
requirements.txt 93B
mnn_project
__init__.py 222B
lanenet_model.cpp 15KB
kdtree.h 5KB
freeze_lanenet_model.py 3KB
config.ini 309B
convert_lanenet_model_into_mnn_model.sh 228B
kdtree.cpp 13KB
dbscan.hpp 11KB
config_parser.cpp 5KB
lanenet_model.h 6KB
config_parser.h 2KB
data_provider
lanenet_data_feed_pipline.py 13KB
tf_io_pipline_tools.py 11KB
README.md 4KB
trainner
tusimple_lanenet_single_gpu_trainner.py 15KB
__init__.py 225B
tusimple_lanenet_multi_gpu_trainner.py 27KB
config
tusimple_lanenet.yaml 3KB
共 81 条
- 1
资源评论
- 不及公子风流2024-05-21资源有一定的参考价值,与资源描述一致,很实用,能够借鉴的部分挺多的,值得下载。
极智视界
- 粉丝: 2w+
- 资源: 1597
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功