Skip to content
Deep GrabCut in PyTorch
Python Shell
Branch: master
Clone or download
Latest commit da559c0 Apr 24, 2019
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
.gitignore update Apr 24, 2019
LICENSE Initial commit May 23, 2018 update Feb 22, 2019 Completed Version Jun 16, 2018 Add coco dataloader Oct 29, 2018 update training configuration Nov 2, 2018

Deep GrabCut (DeepGC)


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


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

  1. Clone the repo:

    git clone
    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:


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
    cd ..
  2. Set the paths in, so that they point to the location of VOC/SBD dataset.

  3. Run python to train Deep Grabcut.

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

You can’t perform that action at this time.