Rintarooo / PSPNet

Semantic Segmentation for CityScapes dataset, Pyramid Scene Parsing Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation for CityScapes dataset

Straightforward implementation of Segmentation for CityScapes dataset

Description

First, you can go to the official site(https://www.cityscapes-dataset.com/downloads/).

Then, download leftImg8bit_trainvaltest.zip(11GB) and gtFine_trainvaltest.zip(241MB). Make sure that you've registered your email on this site before downloading and that email is not a gmail account.

I personally used 2975 images as train data, 500 images as both validation and test data. I saved configuration details in files located at Csv dir.

Pyramid Scene Parsing Network (PSPNet) is the model architecture proposed by this paper(https://arxiv.org/abs/1612.01105).

Input Image(left), Output Image(center), Ground Truth(right)

Usage

generate the pickle file contaning hyperparameter values by running the following command.

python config.py (-h)

you will see the pickle file in Pkl dir.
now you can start training the model.

python train.py -p Pkl/***.pkl

After training is done, you could see prediction of pretrained model

python infer.py -p Weights/***.pt

Dependencies

  • Python = 3.6.10
  • PyTorch = 1.6.0
  • OpenCV (pip install opencv-python)
  • numpy
  • matplotlib (only for test)

Environment

I leave my own environment below. I tested it out on a single GPU.

PSPNet is a kind of large model architecture, so the bigger GPU memory is desirable for training.

  • OS:
    • Linux(Ubuntu 18.04.5 LTS)
  • GPU:
    • NVIDIA® GeForce® RTX 2080 Ti VENTUS 11GB OC
  • CPU:
    • Intel® Xeon® CPU E5640 @ 2.67GHz

Reference

About

Semantic Segmentation for CityScapes dataset, Pyramid Scene Parsing Network


Languages

Language:Python 100.0%