編碼“通過自我注意力蒸餾學習輕量級車道檢測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上。
如果您在復制結果時有任何問題,請在此存儲庫中提出一個問題。