Skip to content
Deep GrabCut in PyTorch
Python Shell
Branch: master
Clone or download
Latest commit da559c0 Apr 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dataloaders Fixed an error Nov 1, 2018
doc Completed Version May 30, 2018
ims Completed Version May 30, 2018
layers first commit May 23, 2018
models update Apr 24, 2019
networks
.gitignore update Apr 24, 2019
LICENSE Initial commit May 23, 2018
README.md update Feb 22, 2019
demo.py Completed Version Jun 16, 2018
mypath.py Add coco dataloader Oct 29, 2018
train.py update training configuration Nov 2, 2018
train_coco.py

README.md

Deep GrabCut (DeepGC)

DEXTR

This is a PyTorch implementation of Deep GrabCut, for object segmentation. We use DeepLab-v2 instead of DeconvNet in this repository.

Installation

The code was tested with Python 3.5. To use this code, please do:

  1. Clone the repo:

    git clone https://github.com/jfzhang95/DeepGrabCut-PyTorch
    cd DeepGrabCut-PyTorch
  2. Install dependencies:

    pip install pytorch torchvision -c pytorch
    pip install matplotlib opencv pillow
  3. You can download pretrained model from GoogleDrive, and then put the model into models/

  4. To try the demo of Deep GrabCut, please run:

    python demo.py

If installed correctly, the result should look like this:

Note that the provided model was trained only on VOC 2012 dataset. You will get better results if you train model on both VOC and SBD dataset.

To train Deep GrabCut on VOC (or VOC + SBD), please follow these additional steps:

  1. Download the pre-trained PSPNet model for semantic segmentation, taken from this repository.

    cd models/
    chmod +x download_pretrained_psp_model.sh
    ./download_pretrained_psp_model.sh
    cd ..
  2. Set the paths in mypath.py, so that they point to the location of VOC/SBD dataset.

  3. Run python train.py to train Deep Grabcut.

  4. If you want to train model on COCO dataset, you should first config COCO dataset path in mypath.py, and then run python train_coco.py to train model.

You can’t perform that action at this time.