-
Download PASCAL-Part dataset [https://cs.stanford.edu/~roozbeh/pascal-parts/pascal-parts.html]
-
Download the multi-class annotations from [http://cvteam.net/projects/2019/multiclass-part.html]
-
Modify the configurations in /experiments/BSANet/config.py. (The parameters are not carefully tuned, simply change them may get higher performance.)
-
Modify the dataset path in /lib/datasets
PASCAL-Person-Part Dataset: http://cvteam.net/projects/2019/figs/pascal_person_part.zip
(There might be different versions of this dataset, we follow the annotations of CVPR17 to make fair comparisons.)
PASCAL-Part-multi-class Dataset: http://cvteam.net/projects/2019/figs/Affined.zip
-
Download the pretrained model and modify the path in /experiments/config.py
-
RUN /experiments/BSANet/test.py
-
(Additionally) If customize data, you need to generate a filelist following the VOC format and modify the dataset path.
If training from scratch, simply run. If not, customize the dir in /experiments/forXXdataset/BSANet config.py.
(A training demo code is provided in train.py)
-
(Additionally) download the ImageNet pretrained model:
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth',
'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth',
}
-
Prerequisites: generate semantic part boundaries and semantic object labels. (will be provided soon)
-
RUN /experiments/BSANet/train.py for 100 epochs. (Achieve 58.09 mIoU)
-
Fine-tune the model using learning rate=0.003 for another 60 epochs. (Achieve 58.43 mIoU)
ResNet-101 Model for 58 classes without finetune:https://drive.google.com/open?id=1Z2xogLfkb_Y7RaoqLJ2Fgx4UfJfOjIGp
The code is an modified version of original code, which follows the same settings and achieves slightly better performance. But you can still compare your results following the paper.
See Results.md for details. (58.43 mIoU using ResNet-101 backbone on 58 part classes, and 68.477 mIoU using ResNet-152 backbone on PASCAL-Person).
This code is tested on python 3.6 and PyTorch=0.4.0 and modified from deeplabv3 re-implementation [http://github.com/YudeWang/deeplabv3plus-pytorch]. The performance will slightly drop down under different environment (bugs requires to be fixed).
For problems and bugs, we will pursue better code in the next few months.
- More backbones, including Xception.
- Light-weight models, including ResNet-18.
- FP16 training code
If use this code, please cite our paper in ICCV19: