This repository contains a PyTorch implementation of MiniNet-v2 for semantic segmentation.
First, you can install the dependencies using a virtual environment. This setup has been tested with Python 3.10:
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
We provide a script for downloading the Cityscapes dataset using the cityscapesscripts package. You will need an account in the Cityscapes website to access the data.
bash download_datasets.sh
Once the dataset is downloaded, you can train a model with default settings running the training script:
python train_segmentation.py
This script by default will save checkpoints during the training in results/<date>/checkpoint_<epoch>.tar.
The inference.ipynb notebook contains an example of how to use the model for segmentation tasks. We also include a script to prepare a submission to the Cityscapes evaluation server using the test images:
python prepare_submission.py --model-path results/<date>/checkpoint_<epoch>.tar
If you find this code useful in your research, please cite the original paper:
@article{alonso2020mininet,
title = {{MiniNet}: An Efficient Semantic Segmentation {ConvNet} for Real-Time Robotic Applications},
author = {Alonso, I{\~n}igo and Riazuelo, Luis and Murillo, Ana C.},
journal = {IEEE Transactions on Robotics (T-RO)},
year = {2020},
volume = {36},
number = {4},
pages = {1340--1347},
doi = {10.1109/TRO.2020.2974099},
}