This project contains two experiments for semantic segmentation using a Modified Version of the U-Net model. The first experiment is semantic segmentation for one class, like cars, and the second experiment considers multiple classes. The experiments run on the Pytorch platform and Python 3.7. Mapillary Vistas dataset is used during the experiments.
parameters.py
: All project parameters are defined in this file, including input and output paths.dataset.py
: A helper class for training takes images and targets dataset, then provides pair-batches of the dataset during the training process.models.py
: This file contains an implementation of the U-Net modified version.prediction.py
: This file applies the saved trained semantic segmentation model to a video. It generates a new video with the segmentation results.imageprocessing.py
: This file generates semantic segmentation masks given a label segmentation image. The masks are provided in separated folders based on the class name.
In this experiment, a semantic segmentation for one class is done by approaching cars as a target class. The training is only applied on 5K8K images and 1.21.5K images as a validation dataset. The experiement code is provided in vehicle-segmentation
folder. The pixel accuracy reachs to 87%. The trained model is applied on a video recorded in Dubai, UAE.
In this experiment, we consider five classes: road, sidewalk, curb, crosswalk, and lane line. The experiement code is provided in sidewalk-segmentation
folder. The accuracy reaches 95% pixel accuracy.