This project focuses on semantic lane segmentation using a U-Net architecture tailored for Indian road conditions. The model is trained on a custom annotated dataset where each pixel is classified into multiple lane categories. U-Net is chosen for its encoder-decoder design, making it ideal for pixel-level segmentation tasks.
The training pipeline supports:
- Multi-class segmentation
- Extensive metric evaluation (Pixel Accuracy, IoU, Precision, Recall, F1-score, Dice Coefficient)
- Automated plotting and saving of training metrics
- Final model saving and result visualization
pip install -r requirements.txt- torch==2.6.0
- torchvision==0.21.0
- numpy==1.26.4
- Pillow==10.2.0
- pyyaml==6.0.2
- tqdm==4.66.6
- matplotlib==3.8.4
- scikit-learn==1.5.1
- opencv-python==4.11.0.86
- pandas==2.2.3
![]() |
![]() |
-
Load the Dataset The dataset is stored in the data/processed/ directory and is already split into two sets:
-
Train and Validation Sets
-
train/ contains:
- images/ — input road images
- masks/ — corresponding segmentation masks
-
val/ contains:
- images/ — input validation images
- masks/ — corresponding masks for evaluation
- Train the Model Execute the training script, which:
- Loads the dataset
- Initializes the U-Net model
- Starts training and logs all metrics/graphs to the graphs/ folder
python train.py

