Real-time Segmentation - A Study of Approaches [PDF]
This repository contains the code for Segmentation Project to fullfil the completion of the course, Neural Networks: Theory and Implementation (Winter 2020/2021).
The Cityscapes dataset, which can be downloaded here.
NOTE: The code has been tested in Ubuntu 18.04, and requirements.txt contains all the nessary packages.
The notebook, Vision_task_1.ipynb contains the training, evaluation and demo implementation.
We evaluate the model with PASCAL VOC 2012. The network is an mobilenet-v3, along with PSP module.
Both the tasks use the same framework with changes only to the model architecture.
To train the model, we run train.py
python3 train.py --root Cityscapes_root_directory --model_path optional_param, to resume training from a checkpoint.
The trainer, also evaluates the model for every save and logs the results, but if evaluation needs to be done for a particular model, we run evaluate.py
python3 evaluate.py --root Cityscapes_root_directory --model_path saved_model_path_to_evaluate.
To visulaize the results, we run demo.py.
python3 demo.py --root Cityscapes_root_directory --model_path saved_model_path_to_run_demo.
For task 2, we use the model configuration as mentioned in TABLE IV of R2U-Net.
The pretrained model is available here [4.36 MB]
And, a prediction of Task-2,
Our network achieves a mIoU of 64.32 on the Cityscapes val set without any pretrained model. And for an input resolution of 2048x1024, our network can run at the speed of 21.8 FPS on a single RTX 2070 GPU.
Model architecture of Task 3,
The pretrained model is available here [13.07 MB]
And, a prediction of Task-3,
Training code inpired from CoinCheung/BiSeNet