LaneNet车道线检测代码复现过程


本文是LaneNet车道线检测效果复现,不涉及原理讲解部分。

开门见山,上链接:
链接:https://pan.baidu.com/s/1yxJNDdR1y4ixW62gDuDawQ
提取码:hcwi

关于LaneNet算法,网上有很多资料,Github上面也有很多,可能是自身检索能力有限,捣鼓了几天,迟迟不能复现代码的效果。主要原因就是某些文件找不到,下载不下来。现在相关文件均放在百度网盘里面了。

windows系统
python3.5.2
相关库具体版本见requirements_new.txt
更新时间2020.06.09

1.下载压缩包,解压,注意这里面的model文件夹下的New_Tusimple_Lanenet_Model_Weights权重文件是自己添加的,某些Github或者博客中并未提供。(为了这个权重,我真是费尽心思,现在分享在百度云盘里New_Tusimple_Lanenet_Model_Weights提取码:s40b)
在这里插入图片描述
在这里插入图片描述
2. 修改tools文件夹下的test_lanenet.py文件,添加相关路径,不然会报错。
在这里插入图片描述
修改成自己的路径

1
2
3
4
5
6
import sys
sys.path.append('C:/Users/Lenovo/Desktop/lanenet-lane-detection-master')
sys.path.append('C:/Users/Lenovo/Desktop/lanenet-lane-detection-master/config')
sys.path.append('C:/Users/Lenovo/Desktop/lanenet-lane-detection-master/data_provider')
sys.path.append('C:/Users/Lenovo/Desktop/lanenet-lane-detection-master/lanenet_model')
sys.path.append('C:/Users/Lenovo/Desktop/lanenet-lane-detection-master/tools')
  1. lanenet-lane-detection-master文件夹下,运行命令
1
python tools/test_lanenet.py --weights_path model/New_Tusimple_Lanenet_Model_Weights/tusimple_lanenet_vgg.ckpt  --image_path data/tusimple_test_image/0.jpg
  1. 注意pictures文件夹是我自己新建的,用于保存检测结果的图片,源码中没有这个文件夹。注意requirements_new.txt列出了我电脑装的一些库版本,和原作者版本有些出入,但是并不影响。注意data/tusimple_test_image文件夹保存有测试图片,测试效果很好。你也可以放自己的图片进行检测,但是我测试自己的车道线效果并不好,甚至说很差,原因暂时未知。
  2. 测试效果
    在这里插入图片描述
    上面测试效果还不赖,可是我换成自己的数据集,车道线就飞到天上了。。。
    在这里插入图片描述