PyTorch implementation of "Soft Proposal Networks for Weakly Supervised Object Localization", ICCV 2017.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
demo minor changes Jan 4, 2018
spnlib add evaluation demo Jan 3, 2018
LICENSE Create LICENSE Jul 8, 2018 add evaluation demo Jan 3, 2018
environment.yml add python environment.yml Nov 1, 2017
vis.png add evaluation demo Jan 3, 2018

PyTorch implementation of SPN

Soft Proposal Networks for Weakly Supervised Object Localization, ICCV 2017.

[Project Page] [Paper] [Supp]

[Torch code]


Conda virtual environment is recommended: conda env create -f environment.yml

  • Python3.5
  • PyTorch: conda install pytorch torchvision -c soumith
  • Packages: torch, torchnet, numpy, tqdm


  1. Clone the SPN repository:

    git clone
  2. Download the backbone model VGG16 (exported from caffe model) and then the model path should be SPN.pytorch/demo/models/

  3. Install SPN:

    cd SPN.pytorch/spnlib
  4. Run the training demo:

    cd SPN.pytorch/demo
  5. Run the testing demo: EvaluationDemo.ipynb Figure Note: To perform bbox localization on ImageNet, firstly download the SP_GoogleNet_ImageNet model and the annotations into imagenet_eval folder. Extraxt the annotations:

    cd SPN.pytorch/demo/evaluation/imagenet_eval
    tar zxvf ILSVRC2012_bbox_val_v3.tgz    


If you use the code in your research, please cite:

    author = {Zhu, Yi and Zhou, Yanzhao and Ye, Qixiang and Qiu, Qiang and Jiao, Jianbin},
    title = {Soft Proposal Networks for Weakly Supervised Object Localization},
    booktitle = {ICCV},
    year = {2017}


In this project, we reimplemented SPN on PyTorch based on wildcat.pytorch. To keep consistency with the Torch version, we use the VGG16 model exported from caffe in fcn.pytorch.