Lane-Detection system used to predict the lane in which a car will be able to drive. In this project, I use a deep learning-based approach using a fully convolutional network to output an image of a predicted lane. This architecture is based on SegNet an Encoder-Decoder Architecture for Image Segmentation. The model first predicts the Lane after which it is drawn in Green color on a blank image then it is merged with the original image.
SegNet is a semantic segmentation model. This core trainable segmentation architecture consists of an encoder network, a corresponding decoder network followed by a pixel-wise classification layer.
This is the visualization of the architecture of the CNN model that is being used for Lane Detection.
To be able to run this you need to have installed
- Tensorflow
- OpenCV
- Numpy
- Pickle
- Scipy version 1.1.0
- Scikit learn
- MoviePy
- Keras
- Visual Keras
- lane-detection.ipynb - In this file it shows how the data has been normalized, the training of the model is also present here and you can see the CNN that has been used here.
- models - This directory consists the trained models in different formats. They are available in h5,tar and pth format.
- model-prediction.ipynb - Using any one of the trained model files from the above folder and an input video, this predicts the lane, and returns the original video with predicted lane lines drawn onto it.
- model-visualization.ipynb - Using visualkeras to visualize the SegNet architecture.
- Results - Here I have added some of the results that has been predicted.
The images were collected from a mix of different times of day, weather, traffic, and road curvatures.
- Some are from clear night driving, some are from rainy morning driving, and rest from cloudy afternoon driving.
- The roads also contain difficult areas such as construction and intersections.
- Some are straight or mostly straight roads, some are a mix or moderate curves, and most are very curvy roads.
- Finally, horizontal flips of each and every road image and its corresponding label were added, so at the end a total of 12,764 images are present in the dataset.
The full set of images used are here and the full set of labels (which are just the 'G' channel from an RGB image of a re-drawn lane) here