Codesfor"LearningLightweightLaneDetectionCNNsbySelfAttentionDistillation"
ThisrepoalsocontainsTensorflowimplementationof"SpatialAsDeep:SpatialCNNforTrafficSceneUnderstanding".(SCNN-Tensorflow)
NewsERFNet-CULane-PyTorchhasbeenreleased.(Itcanachieve73.1F1-measureinCULanetestingset)
ENet-Label-Torch,ENet-TuSimple-TorchandENet-BDD100K-Torchhavebeenreleased.
Keyfeatures:
(1)ENet-labelisalight-weightlanedetectionmodelbasedonENetandadoptsselfattentiondistillation(moredetailscanbefoundinourpaper).
(2)Ithas20×fewerparametersandruns10×fastercomparedtothestate-of-the-artSCNN,andachieves72.0(F1-measure)onCULanetestingset(betterthanSCNNwhichachieves71.6).Italsoachieves96.64%accuracyinTuSimpletestingset(betterthanSCNNwhichachieves96.53%)and36.56%accuracyinBDD100Ktestingset(betterthanSCNNwhichachieves35.79%).
(3)ApplyingENet-SADtoLLAMASdatasetyields0.635mAPinthemulti-classlanemarkersegmentationtask,whichismuchbetterthanthebaselinealgorithmwhichachieves0.500mAP.Detailscanbefoundinthisrepo.
(Donothesitatetotryourmodel!!!)
Multi-GPUtraininghasbeensupported.JustchangeBATCH_SIZEandGPU_NUMinglobal_config.py,andthenuseCUDA_VISIBLE_DEVICES="0,1,2,3"pythonfile_name.py.Thanks@yujincheng08.ContentInstallationDatasetsTuSimpleCULaneBDD100KSCNN-TensorflowTestTrainPerformanceOthersCitationAcknowledgementContactInstallationInstallnecessarypackages:condacreate-ntensorflow_gpupippython=3.5sourceactivatetensorflow_gpupipinstall--upgradetensorflow-gpu==1.3.0pip3install-rSCNN-Tensorflow/lane-detection-model/requirements.txtDownloadVGG-16:Downloadthevgg.npyhereandputitinSCNN-Tensorflow/lane-detection-model/data.
Pre-trainedmodelfortesting:Downloadthepre-trainedmodelhere.
DatasetsTuSimpleTheground-truthlabelsofTuSimpletestingsetisnowavailableatTuSimple.Theannotatedtraining(#frame=3268)andvalidationlabels(#frame=358)canbefoundhere,pleaseusethem(list-name.txt)toreplacethetrain_gt.txtandval_gt.txtintrain_lanenet.py.Moreover,youneedtoresizetheimageto256x512insteadof288x800inTuSimple.Remembertochangethemaximumindexofrowsandcolumns,anddetailedexplanationscanbeseenhere.Pleaseevaluateyourpred.jsonusingthelabelsandthisscript.Besides,togeneratepred.json,youcanrefertothisissue.
CULaneThewholedatasetisavailableatCULane.
BDD100KThewholedatasetisavailableatBDD100K.
SCNN-TensorflowTestcdSCNN-Tensorflow/lane-detection-modelCUDA_VISIBLE_DEVICES="0"pythontools/test_lanenet.py--weights_pathpath/to/model_weights_file--image_pathpath/to/image_name_list--save_dirto_be_saved_dirNotethatpath/to/image_name_listshouldbeliketest_img.txt.Now,yougettheprobabilitymapsfromourmodel.Togetthefinalperformance,youneedtofollowSCNNtogetcurvelinesfromprobabilitymapsaswellascalculateprecision,recallandF1-measure.
Reminder:youshouldchecklanenet_data_processor.pyandlanenet_data_processor_test.pytoensurethattheprocessingofimagepathisright.Youarerecommendedtousetheabsolutepathinyourimagepathlist.Besides,thiscodeneedsbatchsizeusedintrainingandtestingtobeconsistent.Toenablearbitrarybatchsizeinthetestingphase,pleaserefertothisissue.
TrainCUDA_VISIBLE_DEVICES="0"pythontools/train_lanenet.py--netvgg--dataset_dirpath/to/CULane-dataset/Notethatpath/to/CULane-dataset/shouldcontainfilesliketrain_gt.txtandval_gt.txt.
PerformanceTuSimpletestingset:ModelAccuracyFPFNSCNN-Torch96.53%0.06170.0180SCNN-Tensorflow------ENet-Label-Torch96.64%0.06020.0205Thepre-trainedmodelfortestingishere.(comingsoon!)NotethatinTuSimple,SCNN-TorchisbasedonResNet-101whileSCNN-TensorflowisbasedonVGG-16.InCULaneandBDD100K,bothSCNN-TorchandSCNN-TensorflowarebasedonVGG-16.
CULanetestingset(F1-measure):CategorySCNN-TorchSCNN-TensorflowENet-Label-TorchERFNet-CULane-PyTorchNormal90.690.290.791.5Crowded69.771.970.871.6Night66.164.665.967.1Noline43.445.844.745.1Shadow66.973.870.671.3Arrow84.183.885.887.2Dazzlelight58.559.564.466.0Curve64.463.465.466.3Crossroad1990413727292199Total71.671.372.073.1Runtime(ms)133.5--13.410.2Parameter(M)20.72--0.982.49Thepre-trainedmodelfortestingishere.NotethatyouneedtoexchangetheorderofVGG-MEANintest_lanenet.pyandchangetheorderofinputimagesfromRGBtoBGRsincethepre-trainedmodelusesopencvtoreadimages.Youcanfurtherboosttheperformancebyreferringtothisissue.
BDD100Ktestingset:ModelAccuracyIoUSCNN-Torch35.79%15.84SCNN-Tensorflow----ENet-Label-Torch36.56%16.02TheaccuracyandIoUoflanepixelsarecomputed.Thepre-trainedmodelfortestingishere.(comingsoon!)
OthersCitationIfyouusethecodes,pleasecitethefollowingpublications:
@article{hou2019learning,title={LearningLightweightLaneDetectionCNNsbySelfAttentionDistillation},author={Hou,YuenanandMa,ZhengandLiu,ChunxiaoandLoy,ChenChange},journal={arXivpreprintarXiv:1908.00821},year={2019}}@inproceedings{pan2018SCNN,author={XingangPan,JianpingShi,PingLuo,XiaogangWang,andXiaoouTang},title={SpatialAsDeep:SpatialCNNforTrafficSceneUnderstanding},booktitle={AAAIConferenceonArtificialIntelligence(AAAI)},month={February},year={2018}}@misc{hou2019agnostic,title={AgnosticLaneDetection},author={YuenanHou},year={2019},eprint={1905.03704},archivePrefix={arXiv},primaryClass={cs.CV}}AcknowledgementThisrepoisbuiltuponSCNNandLaneNet.
ContactIfyouhaveanyproblemsinreproducingtheresults,justraiseanissueinthisrepo.
To-DoListTestSCNN-TensorflowinTuSimpleandBDD100KProvidedetailedinstructionstorunSCNN-TensorflowinTuSimpleandBDD100KUploadourlight-weightmodel(ENet-SAD)anditstraining&testingscripts
评论