Git Product home page Git Product logo

c4's Introduction

Cascading Convolutional Color Constancy

Huanglin Yu, Ke Chen*, Kaiqi Wang, Yanlin Qian, Zhaoxiang Zhang, Kui Jia     AAAI 2020

This implementation uses Pytorch.

Installation

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.

Download

Dataset

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

  • 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

Run code

Open the visdom service

python -m visdom.server -p 8008

Training

  • Please train the three-fold models (modify foldnum=0 to be foldnum=1 or foldnum=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

Testing

  • 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.

c4's People

Contributors

yhlscut avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.