Skip to content

Susreel7/Lane-Detection-Using-Attention-Based-Fully-Convolutional-Networks

Repository files navigation

Lane Detection and Classification using Cascaded CNNs

This repository contains inference code for Lane Detection and Classification using a cascaded approach with Convolutional Neural Networks (CNNs). It utilizes ERFNet for lane segmentation and LCNet for lane classification.

📌 Overview

The system performs two main tasks:

  1. Lane Segmentation: Identifies the pixels belonging to lanes in an image using ERFNet (Efficient Residual Factorized Network).
  2. Lane Classification: Classifies the detected lanes into different types (e.g., continuous, dashed) using LCNet.

This project is designed for inference using pretrained models.

📂 Project Structure

├── main.ipynb           # Main Jupyter Notebook for inference and visualization
├── models/              # Neural network model definitions
│   ├── erfnet.py        # ERFNet architecture
│   └── lcnet.py         # LCNet architecture
├── pretrained/          # Directory for pretrained model weights
│   ├── erfnet_tusimple.pth
│   └── classification_64_3class.pth
├── images/              # Directory for input images
├── functions.py         # Helper functions for visualization
├── loss.py              # Loss functions (used during training)
└── requirements.txt     # Python dependencies

🛠️ Prerequisites

  • Python 3.x
  • PyTorch
  • Torchvision
  • Numpy
  • Matplotlib
  • Pillow (PIL)

⚙️ Installation

  1. Clone the repository (if you haven't already):

    git clone <repository-url>
    cd Cascade-LD-master
  2. Install dependencies:

    pip install -r requirements.txt

🚀 Usage

  1. Open the Jupyter Notebook:

    jupyter notebook main.ipynb
  2. Run the cells:

    • The notebook will load the pretrained models (erfnet_tusimple.pth and classification_64_3class.pth).
    • It will load a sample image from the images/ directory.
    • It performs lane segmentation and classification.
    • Finally, it visualizes the results, showing the detected lanes colored by their instance and class.

📊 Models & Dataset

  • Segmentation Model: ERFNet trained on the TuSimple dataset.
  • Classification Model: LCNet trained to classify lane types (Continuous, Dashed, Double-Dashed).

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📜 License

This project is open source and available under the MIT License.

About

Lane Detection and Classification system using Cascaded CNNs (ERFNet & LCNet). Performs real-time lane segmentation and type classification (continuous, dashed) with high accuracy.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors