Skip to content

ohosseini/DOCS-caffe

Repository files navigation

Deep Object Co-Segmentation (DOCS) - Caffe

This is the caffe implementation of our paper Deep Object Co-Segmentation published at ACCV18. For more information, you can visit the project page. You can also find our pytorch version here.

DOCS Network

Requirements

  • Python 2.7

  • OpenCV 2.4: If you are using anaconda you can install it by running

    conda install -c conda-forge opencv=2.4

Installation

  1. Download the code with
    git clone https://github.com/ohosseini/DOCS-caffe.git
  2. Follow the installation instructions in caffe official website for installing the dependencies.
  3. Make Makefile.config file using the Makefile.config.example.Set.
  4. Set WITH_PYTHON_LAYER := 1 in Makefile.config.
  5. Finally compile the code by running
    cd DOCS-coffe
    make all
    make pycaffe

Demo

First download the model from here and put it in the models/DOCS/.

Then you can run the demo with

sh demo.sh

demo

For more information on how to apply the demo on other images you can check

python models/DOCS/demo.py --help

Training

You can train your own model by running

cd model/DOCS
python train.py 0 --steps 100000 --weights VGG_ILSVRC_16_layers.caffemodel

You can download the initial weights VGG_ILSVRC_16_layers.caffemodel from here, or start the training from scratch by running

python train.py 0 --steps 100000

For more information about training you can check

python train.py --help

A small training set is provided in data/train_examples/ as an example.

Citation

If you use this code, please cite our publication:

Deep Object Co-Segmentation, Weihao Li*, Omid Hosseini Jafari*, Carsten Rother, ACCV 2018.

@InProceedings{DOCS_ACCV18,
  title={Deep Object Co-Segmentation},
  author={Li, Weihao and Hosseini Jafari, Omid and Rother, Carsten},
  booktitle={ACCV},
  year={2018}
}