2018.2发表出来的,文章下载地址:https://arxiv.org/abs/1802.05591
github上代码:https://github.com/MaybeShewill-CV/lanenet-lane-detection
【本文用的还是18年的,没有用最新的】
运行代码时可能出错:
处理:
程序里添加路径
import sys
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-master')
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-master/config')
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-masterdata_provider')
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-master/lanenet_model')
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-master/encoder_decoder_model')
sys.path.append('/home/zengjun/下载/lanenet-lane-detection-master/tools')
对应文件夹里加入一个空的 __init__.py文件
遇到库文件比如cv2等问题,在pycharm里使用更为方便。本文用的python3.5
测试结果:
2019-05-30 20:47:00.556062: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4861 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0, compute capability: 6.1)
INFO:tensorflow:Restoring parameters from model/tusimple_lanenet/tusimple_lanenet_vgg_2018-10-19-13-33-56.ckpt-200000
I0530 20:47:00.557337 7261 tf_logging.py:115] Restoring parameters from model/tusimple_lanenet/tusimple_lanenet_vgg_2018-10-19-13-33-56.ckpt-200000
I0530 20:47:01.835264 7261 test_lanenet.py:127] 单张图像车道线预测耗时: 1.20088s
预测多张,FPS应该会提高,因为预处理时间。
python tools/test_lanenet.py --is_batch True --batch_size 2 --save_dir data/tusimple_test_image/ret --weights_path model/tusimple_lanenet/tusimple_lanenet_vgg_2018-10-19-13-33-56.ckpt-200000 --image_path data/tusimple_test_image/
I0530 21:02:25.781537 9119 test_lanenet.py:208] [Epoch:2] 预处理2张图像, 共耗时: 0.01650s, 平均每张耗时: 0.00825
I0530 21:02:25.835193 9119 test_lanenet.py:215] [Epoch:2] 预测2张图像车道线, 共耗时: 0.05352s, 平均每张耗时: 0.02676s
I0530 21:02:25.957873 9119 test_lanenet.py:245] [Epoch:2] 进行2张图像车道线聚类, 共耗时: 0.10769s, 平均每张耗时: 0.05384
I0530 21:02:25.957981 9119 test_lanenet.py:198] [Epoch:3] 开始图像读取和预处理...
I0530 21:02:25.975388 9119 test_lanenet.py:208] [Epoch:3] 预处理2张图像, 共耗时: 0.01733s, 平均每张耗时: 0.00866
I0530 21:02:26.029834 9119 test_lanenet.py:215] [Epoch:3] 预测2张图像车道线, 共耗时: 0.05430s, 平均每张耗时: 0.02715s
I0530 21:02:26.092286 9119 test_lanenet.py:245] [Epoch:3] 进行2张图像车道线聚类, 共耗时: 0.04747s, 平均每张耗时: 0.02374
I0530 21:02:26.092393 9119 test_lanenet.py:198] [Epoch:4] 开始图像读取和预处理...
I0530 21:02:26.105244 9119 test_lanenet.py:208] [Epoch:4] 预处理2张图像, 共耗时: 0.01278s, 平均每张耗时: 0.00639
I0530 21:02:26.158836 9119 test_lanenet.py:215] [Epoch:4] 预测2张图像车道线, 共耗时: 0.05346s, 平均每张耗时: 0.02673s
I0530 21:02:26.210763 9119 test_lanenet.py:245] [Epoch:4] 进行2张图像车道线聚类, 共耗时: 0.04204s, 平均每张耗时: 0.02102
I0530 21:02:26.210871 9119 test_lanenet.py:198] [Epoch:5] 开始图像读取和预处理...
I0530 21:02:26.227664 9119 test_lanenet.py:208] [Epoch:5] 预处理2张图像, 共耗时: 0.01670s, 平均每张耗时: 0.00835
I0530 21:02:26.280578 9119 test_lanenet.py:215] [Epoch:5] 预测2张图像车道线, 共耗时: 0.05277s, 平均每张耗时: 0.02638s
I0530 21:02:26.344519 9119 test_lanenet.py:245] [Epoch:5] 进行2张图像车道线聚类, 共耗时: 0.04929s, 平均每张耗时: 0.02465
这下面部分运行除了问题,不要看:
自己加了个视频处理显示的py
#video_test.py 可以读取视频与处理后显示
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 18-5-23 上午11:33
# @Author : Luo Yao
# @Site : https://github.com/MaybeShewill-CV/lane