Skip to content

UpendraArun/lane-marking-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Recommended Environment

Anaconda Environment: Download and install from Anaconda.

conda create --name deeplab python=3.10 -y

Activate the environment using the command:

conda activate deeplab`

Install PyTorch from PyTorch

pip install numpy scikit-learn opencv-python pillow 

git clone [email protected]:av2.0/aerial_imagery/lane-marking-detection.git

cd lane-marking-detection/DeepLabV3Plus/pytorch-deeplab-xception/

Dataset preparation

Training Dataset used: skyscapes

Download the datsaset and copy it to the folder skyscapes

Skyscapes dataset folder structure

├── DeepLabV3Plus
├── skyscapes
│   ├── test
│   │   ├──images
│   ├── train
│   │   ├──images
│   │   ├──labels
│   ├── val
│   │   ├──images
│   │   ├──labels

Trained model was then tested on the aerial images obtained from Bavarian open data

Next, to obtain the train dataset augmentation

cd DeepLabV3Plus/pytorch-deeplab-xception-master/dataloaders/datasets

Update the skyscapes dataset base directory path and run this to get the augmented dataset

python skyscapes_data_aug.py

Training

cd DeepLabV3Plus/pytorch-deeplab-xception-master/

change the hyperparameters as needed in train.py and run

python train.py

Changing pretrained weights of the backbone

Xception and ResNet101 are two backbones used in this model.

Download the pretrained weights from the following Model Zoo.

Copy them to /DeepLabV3Plus/pytorch-deeplab-xception-master/modeling/backbone/

For Xception backbone

cd modeling/backbone/

Open xcpetion.py, change the weights path as required.

Same process for ResNet101 backbone.

Bavarian open data aerial image resize for inference

Update the parameters in /DeepLabV3Plus/pytorch-deeplab-xception/bav_photo_resize.py

python bav_photo_resize.py

Inference

cd DeepLabV3Plus/pytorch-deeplab-xception-master/

update the directory paths in predict.py and run

python predict.py

Calculation of number of pixels per class

*Used only for multi-class dataset. Go to the following folder and then run the following file.

cd DeepLabV3Plus/pytorch-deeplab-xception-master/
python calc_num_pixels.py

Results

Training Results on Skyscapes dataset

Sample Scene Ground Truth
Inference 1 (Xception) Inference 2 (ResNet101)

Test Results on Bavarian Open Data

Sample Scene Inference 1 - Multi-Class Inference 2 - Binary-Class

References and links

  • DeepLabv3+ Pytorch implementation: DeepLabV3+
  • Inference: predict
  • TUM Course - Introduction to Deep Learning: IN2346

About

Semantic segmentation of lane markings from aerial imagery using DeepLabV3+ model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages