The code cannot be released right now. Hopefully it will be available in July.
This work reproduces the method Semantic Instance Segmentation with a Discriminative Loss Function in Pytorch.
It is tailored for the Cityscapes dataset. So it is a multi-class implementation, different from CVPPP.
Original code is implemented in Torch, thanks for the contribution of Davy.
References:
Fast Scene Understanding for Autonomous Driving
Semantic Instance Segmentation with a Discriminative Loss Function
- Python 2.7
- Pytorch 0.3.0
- CUDA + cuDNN enabled GPU
- Cityscapes
- Cityscapes scripts
Go to Cityscapes download page and download the first four datasets. Extract the datasets into one folder and name it as "cityscapes".
Downnload the cityscapes scripts, runcreateTrainIdLabelImgs.py
andcreateTrainIdInstanceImgs.py
to generate training labels. The output dimensions of one image mask shold be 1 x num_classes x height x width.
Notice
: Training labels are only used to make the training easier. You should adapt the predicted labels back to its original form for evaluation.
cityscapes.py
Prepare the training and validation datasets.main.py
This scipt contains both training and validation process. However, validation part has not been tested for accuracy. Now it focuses on visulizing the clustering results. So one or two images can be tested to check the performance.loss_function.py
Implementation of the discriminative loss function.clustering.py
Implementation of post-processing part.utils