Unofficial implemention of lanenet model for real time lane detection
Unofficial implemention of lanenet model for real time lane detection
## Serve Your Model If you want to serve your model via a web server you may be interested in [mortred_model_server](https://github.com/MaybeShewill-CV/mortred_model_server) which is a high performace web server for DNN vision models :fire::fire::fire:
## Recently updates 2018.11.10 Adjust some basic cnn op according to the new tensorflow api. Use the traditional SGD optimizer to optimize the whole model instead of the origin Adam optimizer used in the origin paper. I have found that the SGD optimizer will lead to more stable training process and will not easily stuck into nan loss which may often happen when using the origin code. ## Recently updates 2018.12.13 Since a lot of user want a automatic tools to generate the training samples from the Tusimple Dataset. I upload the tools I use to generate the training samples. You need to firstly download the Tusimple dataset and unzip the file to your local disk. Then run the following command to generate the training samples and the train.txt file. ```angular2html python tools/generate_tusimple_dataset.py --src_dir path/to/your/unzipped/file ``` The script will make the train folder and the test folder. The training samples of origin rgb image, binary label image, instance label image will be automatically generated in the training/gt_image, training/gt_binary_image, training/gt_instance_image folder.You may check it yourself before start the training process. Pay attention that the script only process the training samples and you need to select several lines from the train.txt to generate your own val.txt file. In order to obtain the test images you can modify the script on your own. ## Recently updates 2020.06.12 Add real-time segmentation model BiseNetV2 as lanenet backbone. You may modify the config/tusimple_lanenet.yaml config file to choose the front-end of lanenet model. New lanenet model trainned based on BiseNetV2 can be found [here](https://www.dropbox.com/sh/0b6r0ljqi76kyg9/AADedYWO3bnx4PhK1BmbJkJKa?dl=0) [BaiduNetDisk](https://pan.baidu.com/s/1sLLSE1CWksKNxmRIGaQn_A) is available too. You can download here https://pan.baidu.com/s/1sLLSE1CWksKNxmRIGaQn_A and extract code is `86sd` The new model can reach 78 fps in single image inference process. ## Recently updates 2022.05.28 Since lots of user have encountered with a empty mask image problem when they do model inference using their own custom data. For example the user [issue](https://github.com/MaybeShewill-CV/lanenet-lane-detection/issues/382) have encountered such a problem. I have openend a discussion [here](https://github.com/MaybeShewill-CV/lanenet-lane-detection/discussions/561#discussion-4104802) to give some advice to solve those problem. That problem mainly caused by the dbscan cluster's params was not properly adjusted for custom data. For example if I use the default dbscan param settled [here](https://github.com/MaybeShewill-CV/lanenet-lane-detection/blob/5f704c86759b0b65955fb27c85a42f343c1c8c5c/config/tusimple_lanenet.yaml#L90-L93) ``` POSTPROCESS: MIN_AREA_THRESHOLD: 100 DBSCAN_EPS: 0.35 DBSCAN_MIN_SAMPLES: 1000 ``` The inference result was When I enlarge the dbscan DBSCAN_EPS param from 0.35 to 0.5 and reduce DBSCAN_MIN_SAMPLES from 1000 to 250. The infer ence result was Some more detailed discussion you may find in [discussion module](https://github.com/MaybeShewill-CV/lanenet-lane-detection/discussions/561#discussion-4104802) The lane fit process in postprocess module was designed for tusimple dataset which means it can not work well on your custorm data. So I add an option in testing scripts to disable this feature when processing custom data. It will plot mask image directly upon source image ``` python tools/test_lanenet.py --weights_path /PATH/TO/YOUR/CKPT_FILE_PATH --image_path ./data/custom_test_image/test.png --with_lane_fit 0 ``` Before you test the example custom data remember to adjust dbscan cluster params following instruction above and the test result should be like To get better lane detection result on your own data you'd better train a new model on custom dataset rather than using the pretrained model directly. Hope it helps:) ## MNN Project Add tools to convert lanenet tensorflow ckpt model into mnn model and deploy the model on mobile device #### Freeze your tensorflow ckpt model weights file ``` cd LANENET_PROJECT_ROOT_DIR python mnn_project/freeze_lanenet_model.py -w lanenet.ckpt -s lanenet.pb ``` #### Convert pb model into mnn model ``` cd MNN_PROJECT_ROOT_DIR/tools/converter/build ./MNNConver -f TF --modelFile lanenet.pb --MNNModel lanenet.mnn --bizCode MNN ``` #### Add lanenet source code into MNN project Add lanenet source code into MNN project and modified CMakeList.txt to compile the executable binary file. ## Status ## Star History ## TODO - [x] Add a embedding visualization tools to visualize the embedding feature map - [x] Add detailed explanation of training the components of lanenet separately. - [x] Training the model on different dataset - ~~[ ] Adjust the lanenet hnet model and merge the hnet model to the main lanenet model~~ - ~~[ ] Change the normalization function from BN to GN~~ ## Acknowledgement The lanenet project refers to the following projects: - [MNN](https://github.com/alibaba/MNN) - [SimpleDBSCAN](https://github.com/CallmeNezha/SimpleDBSCAN) - [PaddleSeg](https://github.com/PaddlePaddle/PaddleSeg) ## Visitor Count ## Contact Scan the following QR to disscuss :)
No open issues yet, or sync has not completed.