Skip to content

TKKim93/sec.pytorch

Repository files navigation

sec.pytorch

This repository is currently being prepared.

This is the pytorch implementation of the ECCV 2016 paper 'Seed, Expand and Constrain: Three Principles for Weakly-Supervised Image Segmentation' (paper).

Acknowledgment

The implementation heavily refers to the python implementation of DeepLab-ResNet (isht7/pytorch-deeplab-resnet) and the public code of Seed, Expand, Constrain (https://github.com/kolesman/SEC).

Dependency preparation

  1. Python packages:
      $ pip install -r python-dependencies.txt
      $ conda install -c conda-forge opencv
      $ conda install -c conda-forge tensorboardx

If you have an issue with numpy.core.multiarray, remove the currently installed numpy from your virtual environment and re-install with the follwing line:

      $ pip install -U numpy
  1. Build the Fully connected CRF wrapper:

Install the Eigen3 package and link the installed custum Eigen3 folder to '/usr/local/include/Eigen'. Then

      $ pip install CRF/
  1. Install PyTorch.
      $ conda install pytorch=0.4.1 torchvision cuda80 -c pytorch

Data preparation

  1. Prepare the initial vgg16 model pretrained on ImageNet.
      $ mkdir vgg16_20M
  1. Prepare localization cues.
      $ cd localization_cues
      $ gzip -kd localization_cues/localization_cues.pickle.gz
  1. Prepare dataset (e.g., PASCAL VOC 2012) and update the directory in train.py.

parser.add_argument('--gt_path', type=str, default='/home/tk/WSSS/dataset/VOC/cls_png')
parser.add_argument('--im_path', type=str, default='/home/tk/WSSS/dataset/VOC/JPEGImages')
parser.add_argument('--list_path', type=str, default='/home/tk/WSSS/dataset/VOC/ImageSets')

About

PyTorch implementation of "Seed, Expand and Constrain: Three Principles for Weakly-Supervised Image Segmentation."

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published