This repository contains the code of the Real-Time Anomaly Segmentation for Road Scenes project of the Advanced Machine Learning course 23/24 - Politecnico di Torino
This repository was built on the following repository base: erfnet_pytorch.
A brief overview of the project is available at s326619_s330509_project4.pdf.
Example of Anomaly scores calculated by an ERFNet model using the MaxLogit inference method.
For instructions, please refer to the README in each folder:
- train contains tools for training the networks for semantic segmentation.
- eval contains tools for evaluating/visualizing the networks' output and performing anomaly segmentation.
- imagenet contains scripts and model for pretraining ERFNet's encoder in Imagenet.
- trained_models contains some trained models used in the papers (almost all the models are available in the Releases section).
- The Cityscapes dataset: Download the "leftImg8bit" for the RGB images and the "gtFine" for the labels. Please note that for training you should use the "_labelTrainIds" and not the "_labelIds", you can download the cityscapes scripts and use the conversor to generate trainIds from labelIds
- For testing the anomaly segmentation models: All testing images are provided here.
The repo provides the following pre-trained networks that can be used to perform anomaly segmentation:
- Erfnet trained on 19 classes of the Cityscapes dataset using a Cross-Entropy loss, Logit Norm + Cross Entropy, Logit Norm + Focal Loss, IsoMax+ + Cross Entropy and IsoMax+ + Focal Loss
- BiSeNetV1 trained on 20 classes (19 + void class) of the Cityscapes dataset
- Enet trained on 20 classes (19 + void class) of the Cityscapes dataset
The AML_Project.ipynb
can be opened on Colab to run all the evaluation commands.
Please refer to the following repo and license for the use and modification of the material contained in the linked repository and modified in this repo.