Home

Awesome

Part-aware-Prototype-Network

Official Implementation of Part-aware Prototype Network for Few-shot Semantic Segmentation (ECCV 2020)

Installation

Dependencies

alt text

Get Started

git clone 
cd PPNet-PyTorch
mkdir logs
mkdir outputs

Data Preparation for VOC Dataset

1. Download Pascal VOC dataset

Please go to PANet and download VOC dataset and put them under FewShotSeg-dataset/Pascal folder.

# symlink the pascal dataset
mkdir -p FewShotSeg-dataset/Pascal
ln -s /path_to_pascal_dataset/ FewShotSeg-dataset/Pascal/

2. Download pretrained model

Download the ResNet50 and Resnet101 weights and put them under FewShotSeg-dataset/cache/ folder.

3. Download the unlabel superpixel data

Download the unlabel superpixel from here and put it under FewShotSeg-dataset/Pascal/superpixel folder. If you want to generate your own superpixel data, please follow the fast_slic.

Training & Evaluation in Command Line for Pascal VOC

# Train baseline model 
sh script/train_fewshot.sh

# Train part model
sh script/train_part.sh

# Train part+semantic branch model
sh script/train_part_sem.sh

# Train part + semantic branch + unlabel data model
sh script/train_graph.sh

Inference by pretrained model

Change the ckpt_dir in script to your pretrained model path.

# Test baseline model 
sh script/test_fewshot.sh

# Test part model
sh script/test_part.sh

# Test part+semantic branch model
sh script/test_part_sem.sh

# Test part + semantic branch + unlabel data model
sh script/test_graph.sh

1-way 1-shot

1-way 1-shotDownload linkmeanIoU
PANet*model49.10
+ PAPmodel50.40
+ PAP + SEMmodel51.50
+ PAP + SEM + UDmodel52.84

log files are available here

N-way K-shot final model

N-way K-shotSettingDownload linkmeanIoU
1-way 5-shot+ PAP + SEM + UDmodel62.97
2-way 1-shot+ PAP + SEM + UDmodel51.65
2-way 5-shot+ PAP + SEM + UDmodel61.30

Visualization for Pascal VOC

alt text

Citation

Please consider citing our paper if the project helps your research. BibTeX reference is as follows.

@inproceedings{liu2020part,
  title={Part-aware Prototype Network for Few-shot Semantic Segmentation},
  author={Liu, Yongfei and Zhang, Xiangyi and Zhang, Songyang and He, Xuming},
  booktitle={European Conference on Computer Vision},
  pages={142--158},
  year={2020},
  organization={Springer}
}

References

Part of our code are based on PANet