Huanglin Yu, Ke Chen*, Kaiqi Wang, Yanlin Qian, Zhaoxiang Zhang, Kui Jia AAAI 2020
This implementation uses Pytorch.
Please install Anaconda firstly.
git clone https://github.com/yhlscut/C4.git
cd C4
## Create python env with relevant packages
conda create --name C4 python=3.6
source activate C4
pip install -U pip
pip install -r requirements.txt
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch # cudatoolkit=10.0 for cuda10
Tested on pytorch >= 1.0 and python3.
Shi's Re-processing of Gehler's Raw Dataset:
- Download the 4 zip files from the website and unzip them
- Extract images in the
/cs/chroma/data/canon_dataset/586_dataset/png
directory into./data/images/
, without creating subfolders. - Masking MCC chats:
bash ./data/run.sh
- Pretrained models can be downloaded here. To reproduce the results reported in the paper, the pretrained models(*.pth) should be placed in
./trained_models/
, and then test model directly
Open the visdom service
python -m visdom.server -p 8008
- Please train the three-fold models (modify
foldnum=0
to befoldnum=1
orfoldnum=2
in line 6 of./scripts/train_sq_1stage.sh
and./scripts/train_sq_3stage.sh
accordingly) - Train the C4_sq_1stage first:
bash ./scripts/train_sq_1stage.sh
- Train the C4_sq_3stage (Before that, please move the directory
./log/C4_sq_1stage
to./trained_model
):
bash ./scripts/train_sq_3stage.sh
- After training, move the trained models directory in
./log/C4_sq_3stage
to./trained_model/
, and run:
bash ./scripts/test_sq_3stage.sh
- To reproduce the results reported in the paper, move the pretrained models(*.pth) downloaded from here to
./trained_models/
, and then test model directly.