This repository is an unofficial semantic segmentation part implementation of Kaiming He, Panoptic Feature Pyramid Networks .
- Semantic Segmentation Branch
- Multiple GPUs training
- Train on CamVid Dataset
- Train on Cityscapes Dataset
- Train on NYUD v2 Dataset
- Train on PASCAL Context Dataset
Not as good as the result in the paper, I am tring to improve it.
Dataset | mIoU | Pixel Acc | FWIoU | Backbone | Trained model |
---|---|---|---|---|---|
CamVid | 0.570 | 0.920 | 0.861 | ResNet101 | CamVid |
Cityscapes | 0.605 | 0.928 | 0.872 | ResNet101 | CityScapes |
- default dataset is CamVid
download pytorch 1.0.0 from pytorch.org
download CamVid dataset or Cityscapes dataset
- for CamVid dataset, make directory "data\CamVid" and put "701_StillsRaw_full", "LabeledApproved_full" in "CamVid", then run:
python data/CamVid_utils.py
- for Cityscapes dataset, make directory "Cityscapes" and put "gtFine" in "Cityscapes/gtFine_trainvaltest" folder, put "test", "train", "val" in "Cityscapes/leftImg8bit" foloder.
train with CamVid dataset:
change to your own CamVid dataset path in mypath.py, then run:
python train_val.py --dataset CamVid --save_dir /path/to/run
for multiple GPUs training, change to your own CamVid dataset path in mypath.py, then run:
python train_val.py --dataset CamVid --save_dir /path/to/run --mGPUs True --gpu_ids 0,1,2
train with Cityscapes(default) dataset: change to your own CityScapes dataset path in mypath.py, then run:
python train_val.py --dataset Cityscapes --save_dir /path/to/run
for multiple GPUs training, change to your own CityScapes dataset path in mypath.py, then run:
python train_val.py --dataset Cityscapes --save_dir /path/to/run --mGPUs True --gpu_ids 0,1,2
Test with CamVid dataset(val), run:
python test --dataset CamVid --exp_dir /path/to/experiment_x
Test with Cityscapes dataset(val), run:
python test.py --dataset Cityscapes --exp_dir /path/to/experiment_x
If you want to plot the color semantic segmentation prediction of the test input color image, please set --plot=True, for example:
python test.py --dataset Cityscapes --exp_dir /path/to/experiment_x --plot True