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.
-
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
- Download the code with
git clone https://github.com/ohosseini/DOCS-caffe.git
- Follow the installation instructions in caffe official website for installing the dependencies.
- Make
Makefile.config file
using theMakefile.config.example.Set
. - Set
WITH_PYTHON_LAYER := 1
inMakefile.config
. - Finally compile the code by running
cd DOCS-coffe make all make pycaffe
First download the model from here and put it in the models/DOCS/
.
Then you can run the demo with
sh demo.sh
For more information on how to apply the demo on other images you can check
python models/DOCS/demo.py --help
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.
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}
}