In this project, a deep learning-based approach is used for lane detection on semi-urban roads. The proposed model consists of two main components: a CNN architecture, ResNet101, for semantic segmentation to accurately detect and classify road features, and YOLOv8 for object detection.
Autonomous vehicles require a precise and accurate perception of their surroundings to
navigate safely. In order for the vehicle to comprehend its position and trajectory on the
road, lane detection is a critical component of this perception. This can be particularly
difficult in semi-urban environments in which there are both residential and commercial
areas and a variety of road types and conditions.
In this project, a deep learning-based approach is used for lane detection on semi-urban
roads. The proposed model consists of two main components: a CNN architecture,
ResNet101, for semantic segmentation to accurately detect and classify road features, and
YOLOv8 for object detection. This approach aims to handle the variability and
complexity of semi-urban road environments, such as road surface textures.
A dataset of semi-urban road images is used for training the model to track lanes, other
vehicles, and obstacles in real time. The ResNet101 model is trained for semantic
segmentation, which helps in understanding the road environment and identifying
different road types and conditions. YOLOv8, on the other hand, is used for object
detection, which helps in localizing and classifying objects in the scene, such as vehicles
and pedestrians.
The two models allow the autonomous vehicle to have a precise and accurate perception
of its surroundings, enabling it to navigate safely in semi-urban environments with
various road types and conditions.
End to End semantic segmentation based drivable road detection on unstructured roads for self driving cars.
A PyTorch implementation of drivable road region detection and steering angle estimation methods proposed for the autonomous vehicle. The dataset has been taken from CARL-DATASET
- Windows
- Anaconda Python(Spyder)
- PyTorch==2.0.1+cu118
- Albumentations==1.0.3
- Tensorboard==1.6.0
- TensorboardX==2.2
- Ultralytics
The CARL-Dataset – a benchmark designed for drivable road region detection on unstructured roads, essential for enabling autonomous driving in the absence of lane markings.
-
15,000 Fine-Annotated Images A rich collection of meticulously annotated images to enhance the robustness of your drivable road region detection models.
-
Diverse Road Types The dataset encompasses a variety of road types, ensuring your model is well-equipped to handle different driving scenarios.
-
Binary Classes
- (i) Road
- (ii) Background Simplifying the task with a binary classification: distinguishing between road and background.
-
COCO Format Annotations Annotations are structured in COCO format, providing a standardized and widely used format for seamless integration into your computer vision projects.
-
Polygonal Annotations Annotations in the form of polygons, allowing for precise delineation of drivable road regions.
We have seamlessly integrated our own dataset, enhancing the diversity and complexity of object detection scenarios.
To further enrich your model's understanding, we've incorporated the PotholeDataset, ensuring drivable road region detection system is adept at identifying potential road hazards.
-
CARL_DATASET:
- test
- test_label
- train
- train_label
- val
- val_label
-
runs: Segmentation logs of the validation data.
-
train_seg_maps: Save predictions of the trained model on randomly selected images during the validation process.
-
utils:
- helper.py
- metrics.py
-
config.py: Configuration file containing dataset path, name, and number of classes. Adjust other parameters as needed.
-
dataset.py: Functions related to the dataset.
-
helper.py: Helper functions for the project.
-
train.py: Used to train the model.
-
road_detection_test.py: Test the model on randomly selected images.
-
test_vid.py: Detect driveable road regions in a given video input.
-
model.py: Train the model from scratch.
-
engine.py: Save the model as a model.pth.
-
metrics.py: Helper functions to measure performance metrics.
-
yolov8.py: implementation for real-time object detection with seamless integration, training support, and customization options.
Feel free to explore, experiment, and contribute to advancing drivable road region detection for autonomous driving! 🚗💨
- Train the model for the first time on the road detection dataset CARL-DATASET.
- Before starting training, place the downloaded dataset folders (train, train_labels, test, test_labels, val, and val_labels) in the CARL-Dataset directory.
- After completion, verify the root paths and other configurations in 'config.py'.
- Run the following command:
python train.py --resume-training no
- Test the model on an image using the following command:
Example:
python test_road_detection.py --model-path <path to saved checkpoint/weight file> --input <path to image>
python test_road_detection.py --model-path model.pth --input abc.jpg
- Test the model on a video using the following command:
Example:
python test_vid.py --input <path to video> --model-path <path to saved checkpoint/weight file>
python test_vid.py --input DSC_0006.mp4 --model-path model.pth
Make sure to adjust paths and filenames according to the specific setup.