This is a pytorch implementation of the TripleNet and PairNet models from the paper Triply Supervised Decoder Networks for Joint Detection and Segmentation.
NOTE: If you want to run the models with semantic segmentation task only, you can checkout the seg_only_models
branch and follow the README in that branch.
Use the package manager pip to install the required packages for preparing the dataset, training and testing the model.
pip install -r requirements.txt
Download dataset VOC2007, put them under VOCdevkit
directory as the following directory structure:
VOCdevkit
-| VOC2007
-| Annotations
-| ImageSets
-| JPEGImages
-| SegmentationClass
-| SegmentationObject
python train.py --model='model name' --run_name='experiment name'
Example:
python train.py --model=pairnet --run_name=pairnet_voc_2007
To train TripleNet model, switch model
to model=triplenet
python test.py --model='model name' --model_checkpoint='path to saved model checkpoint'
Example:
python test.py --model=pairnet --model_checkpoint=checkpoints/pairnet_voc_2007/epoch=99-step=36083.ckpt
We have uploaded pretrained models of our experiments. You can download them from [OneDrive]:
Pairnet
TripleNet
Download it and put it into the model_checkpoint folder.
Most of the code in Dataset/
and utils/
is from the following repos
- [1] SSD-variants
- [2] pytorch-segmentation