编码“通过自我注意力蒸馏学习轻量级车道检测CNN”
该仓库还包含“空间为深:空间CNN,用于交通现场的理解”的张量实现。 (scnn-tensorflow)
Erfnet-Culane-Pytorch已发布。 (它可以在Culane测试集中实现73.1 F1量度)
ENET标签 - 孔,Enet-tusimple-Torch和Enet-BDD100K-Torch已释放。
关键功能:
(1)ENET标签是基于ENET的轻型车道检测模型,并采用了自我注意力蒸馏(更多细节可以在我们的论文中找到)。
(2)它的参数较少20 ×,并且与最先进的SCNN相比,运行速度更快,并且在Culane测试集上实现了72.0 (F1量)(比实现71.6的SCNN)。它还在Tusimple测试集(比SCNN更好,可实现96.53%)和BDD100K测试集的精度为36.56 % (比SCNN(优于实现35.79%的SCNN),它还达到了96.64%的精度。
(3)将ENET-SAD应用于Llamas数据集,在多级车道标记分段任务中得出0.635 MAP,这比获得0.500 MAP的基线算法要好得多。详细信息可以在此存储库中找到。
(请随时尝试我们的模型!!!)
CUDA_VISIBLE_DEVICES="0,1,2,3" python file_name.py 。谢谢 @ yujincheng08。 conda create -n tensorflow_gpu pip python=3.5
source activate tensorflow_gpu
pip install --upgrade tensorflow-gpu==1.3.0
pip3 install -r SCNN-Tensorflow/lane-detection-model/requirements.txt
在此处下载vgg.npy,然后将其放入scnn-tensorflow/lane-tection-tection-model/data中。
在此处下载预训练的模型。
Tusimple现在可以在Tusimple提供Tusimple测试集的地面真相标签。可以在此处找到带注释的培训(#frame = 3268)和验证标签(#frame = 358),请使用它们(list-name.txt)替换Train_gt.txt和train_lanenet.py中的Train_gt.gt.txt和val_gt.txt。此外,您需要将图像大小调整为256 x 512,而不是Tusimple中的288 x 800。请记住要更改行和列的最大索引,并在此处看到详细的解释。请使用标签和此脚本评估您的pred.json。此外,要生成pred.json,您可以参考此问题。
整个数据集可在Culane上找到。
整个数据集可在BDD100K上找到。
cd SCNN-Tensorflow/lane-detection-model
CUDA_VISIBLE_DEVICES="0" python tools/test_lanenet.py --weights_path path/to/model_weights_file --image_path path/to/image_name_list --save_dir to_be_saved_dir
请注意,路径/到/image_name_list应该像test_img.txt一样。现在,您可以从我们的模型中获得概率图。要获得最终性能,您需要遵循SCNN以从概率图中获取曲线线,并计算精度,回忆和F1量度。
提醒:您应该检查LANENET_DATA_PROCESSOR.PY和LANENET_DATA_PROCESSOR_TEST.PY,以确保图像路径的处理正确。建议您使用图像路径列表中的绝对路径。此外,此代码需要在培训和测试中使用的批量大小是一致的。要在测试阶段启用任意批次大小,请参阅此问题。
CUDA_VISIBLE_DEVICES="0" python tools/train_lanenet.py --net vgg --dataset_dir path/to/CULane-dataset/
请注意,路径/到/culane-dataset/应包含诸如train_gt.txt和val_gt.txt之类的文件。
| 模型 | 准确性 | fp | fn |
|---|---|---|---|
| scnn-torch | 96.53% | 0.0617 | 0.0180 |
| scnn-tensorflow | - - | - - | - - |
| ENET标签 - 陶器 | 96.64% | 0.0602 | 0.0205 |
预训练的测试模型在这里。 (即将推出!)请注意,在Tusimple中,SCNN-Torch基于Resnet-101,而SCNN-TensorFlow基于VGG-16。在Culane和BDD100K中,SCNN-Torch和SCNN-TensorFlow均基于VGG-16。
| 类别 | scnn-torch | scnn-tensorflow | ENET标签 - 陶器 | Erfnet-Culane-Pytorch |
|---|---|---|---|---|
| 普通的 | 90.6 | 90.2 | 90.7 | 91.5 |
| 挤 | 69.7 | 71.9 | 70.8 | 71.6 |
| 夜晚 | 66.1 | 64.6 | 65.9 | 67.1 |
| 没有行 | 43.4 | 45.8 | 44.7 | 45.1 |
| 阴影 | 66.9 | 73.8 | 70.6 | 71.3 |
| 箭 | 84.1 | 83.8 | 85.8 | 87.2 |
| 耀眼的光 | 58.5 | 59.5 | 64.4 | 66.0 |
| 曲线 | 64.4 | 63.4 | 65.4 | 66.3 |
| 十字路口 | 1990 | 4137 | 2729 | 2199 |
| 全部的 | 71.6 | 71.3 | 72.0 | 73.1 |
| 运行时(MS) | 133.5 | - - | 13.4 | 10.2 |
| 参数(M) | 20.72 | - - | 0.98 | 2.49 |
预训练的测试模型在这里。请注意,您需要在test_lanenet.py中交换VGG均值的顺序,并将输入图像的顺序从RGB更改为BGR,因为预训练的模型使用OpenCV来读取图像。您可以通过参考此问题进一步提高性能。
| 模型 | 准确性 | iou |
|---|---|---|
| scnn-torch | 35.79% | 15.84 |
| scnn-tensorflow | - - | - - |
| ENET标签 - 陶器 | 36.56% | 16.02 |
计算泳道像素的准确性和IOU。预训练的测试模型在这里。 (即将推出!)
如果您使用这些代码,请引用以下出版物:
@article{hou2019learning,
title={Learning Lightweight Lane Detection CNNs by Self Attention Distillation},
author={Hou, Yuenan and Ma, Zheng and Liu, Chunxiao and Loy, Chen Change},
journal={arXiv preprint arXiv:1908.00821},
year={2019}
}
@inproceedings{pan2018SCNN,
author = {Xingang Pan, Jianping Shi, Ping Luo, Xiaogang Wang, and Xiaoou Tang},
title = {Spatial As Deep: Spatial CNN for Traffic Scene Understanding},
booktitle = {AAAI Conference on Artificial Intelligence (AAAI)},
month = {February},
year = {2018}
}
@misc{hou2019agnostic,
title={Agnostic Lane Detection},
author={Yuenan Hou},
year={2019},
eprint={1905.03704},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
此存储库建在SCNN和LANENET上。
如果您在复制结果时有任何问题,请在此存储库中提出一个问题。