All Projects → mahmoudnafifi → Deep_white_balance

mahmoudnafifi / Deep_white_balance

Licence: other
Reference code for the paper: Deep White-Balance Editing, CVPR 2020 (Oral). Our method is a deep learning multi-task framework for white-balance editing.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deep white balance

coursera-ai-for-medicine-specialization
Programming assignments, labs and quizzes from all courses in the Coursera AI for Medicine Specialization offered by deeplearning.ai
Stars: ✭ 80 (-56.52%)
Mutual labels:  image-manipulation, deeplearning
Concise Ipython Notebooks For Deep Learning
Ipython Notebooks for solving problems like classification, segmentation, generation using latest Deep learning algorithms on different publicly available text and image data-sets.
Stars: ✭ 23 (-87.5%)
Mutual labels:  deeplearning, autoencoder
HistoGAN
Reference code for the paper HistoGAN: Controlling Colors of GAN-Generated and Real Images via Color Histograms (CVPR 2021).
Stars: ✭ 158 (-14.13%)
Mutual labels:  image-manipulation, deeplearning
Focal Frequency Loss
Focal Frequency Loss for Generative Models
Stars: ✭ 141 (-23.37%)
Mutual labels:  autoencoder, image-manipulation
Contrastive Unpaired Translation
Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)
Stars: ✭ 822 (+346.74%)
Mutual labels:  deeplearning, image-manipulation
Motion Sense
MotionSense Dataset for Human Activity and Attribute Recognition ( time-series data generated by smartphone's sensors: accelerometer and gyroscope)
Stars: ✭ 159 (-13.59%)
Mutual labels:  deeplearning, autoencoder
Pythonpark
Python 开源项目之「自学编程之路」,保姆级教程:AI实验室、宝藏视频、数据结构、学习指南、机器学习实战、深度学习实战、网络爬虫、大厂面经、程序人生、资源分享。
Stars: ✭ 4,294 (+2233.7%)
Mutual labels:  deeplearning
Deep image prior
Image reconstruction done with untrained neural networks.
Stars: ✭ 168 (-8.7%)
Mutual labels:  autoencoder
Bmw Tensorflow Inference Api Cpu
This is a repository for an object detection inference API using the Tensorflow framework.
Stars: ✭ 158 (-14.13%)
Mutual labels:  deeplearning
Best ai paper 2020
A curated list of the latest breakthroughs in AI by release date with a clear video explanation, link to a more in-depth article, and code
Stars: ✭ 2,140 (+1063.04%)
Mutual labels:  deeplearning
Distancegan
Pytorch implementation of "One-Sided Unsupervised Domain Mapping" NIPS 2017
Stars: ✭ 180 (-2.17%)
Mutual labels:  image-manipulation
Tensorflow 101
中文的 tensorflow tutorial with jupyter notebooks
Stars: ✭ 172 (-6.52%)
Mutual labels:  autoencoder
Libra
Ergonomic machine learning for everyone.
Stars: ✭ 1,925 (+946.2%)
Mutual labels:  deeplearning
Cyclegan Vc2
Voice Conversion by CycleGAN (语音克隆/语音转换): CycleGAN-VC2
Stars: ✭ 158 (-14.13%)
Mutual labels:  deeplearning
Robomaster2018 Seu Opensource
This is the open source project for RoboMaster 2018 contest from Southeast University
Stars: ✭ 169 (-8.15%)
Mutual labels:  deeplearning
Deblurgan
Image Deblurring using Generative Adversarial Networks
Stars: ✭ 2,033 (+1004.89%)
Mutual labels:  image-manipulation
Awesome Deep Learning Music
List of articles related to deep learning applied to music
Stars: ✭ 2,195 (+1092.93%)
Mutual labels:  deeplearning
Airsim
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
Stars: ✭ 12,528 (+6708.7%)
Mutual labels:  deeplearning
Sequitur
Library of autoencoders for sequential data
Stars: ✭ 162 (-11.96%)
Mutual labels:  autoencoder
Deeplearning4j
Suite of tools for deploying and training deep learning models using the JVM. Highlights include model import for keras, tensorflow, and onnx/pytorch, a modular and tiny c++ library for running math code and a java based math library on top of the core c++ library. Also includes samediff: a pytorch/tensorflow like library for running deep learni…
Stars: ✭ 12,277 (+6572.28%)
Mutual labels:  deeplearning

Deep White-Balance Editing, CVPR 2020 (Oral)

Mahmoud Afifi1,2 and Michael S. Brown1

1Samsung AI Center (SAIC) - Toronto

2York University

Oral presentation

deep_WB_fig

Reference code for the paper Deep White-Balance Editing. Mahmoud Afifi and Michael S. Brown, CVPR 2020. If you use this code or our dataset, please cite our paper:

@inproceedings{afifi2020deepWB,
  title={Deep White-Balance Editing},
  author={Afifi, Mahmoud and Brown, Michael S},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2020}
}

network

Training data

  1. Download the Rendered WB dataset.

  2. Copy both input images and ground-truth images in a single directory. Each pair of input/ground truth images should be in the following format: input image: name_WB_picStyle.png and the corresponding ground truth image: name_G_AS.png. This is the same filename style used in the Rendered WB dataset. As an example, please refer to dataset directory.

Code

We provide source code for Matlab and PyTorch platforms. There is no guarantee that the trained models produce exactly the same results.

1. Matlab (recommended)

Prerequisite

  1. Matlab 2019b or higher
  2. Deep Learning Toolbox

Get Started

Run install_.m

Demos:
  1. Run demo_single_image.m or demo_images.m to process a single image or image directory, respectively. The available tasks are AWB, all, and editing. If you run the demo_single_image.m, it should save the result in ../result_images and output the following figure:

  1. Run demo_GUI.m for a gui demo.

Training Code:

Run training.m to start training. You should adjust training image directories from the datasetDir variable before running the code. You can change the training settings in training.m before training.

For example, you can use epochs and miniBatch variables to change the number of training epochs and mini-batch size, respectively. If you set fold = 0 and trainingImgsNum = 0, the training will use all training data without fold cross-validation. If you would like to limit the number of training images to be n images, set trainingImgsNum to n. If you would like to do 3-fold cross-validation, use fold = testing_fold. Then the code will train on the remaining folds and leave the selected fold for testing.

Other useful options include: patchsPerImg to select the number of random patches per image and patchSize to set the size of training patches. To control the learning rate drop rate and factor, please check the get_training_options.m function located in the utilities directory. You can use the loadpath variable to continue training from a training checkpoint .mat file. To start training from scratch, use loadpath=[];.

Once training started, a .cvs file will be created in the reports_and_checkpoints directory. You can use this file to visualize training progress. If you run Matlab with a graphical interface and you want to visualize some of input/output patches during training, set a breakpoint here and write the following code in the command window:

close all; i = 1; figure; subplot(2,3,1);imshow(extractdata(Y(:,:,1:3,i))); subplot(2,3,2);imshow(extractdata(Y(:,:,4:6,i))); subplot(2,3,3);imshow(extractdata(Y(:,:,7:9,i))); subplot(2,3,4); imshow(gather(T(:,:,1:3,i))); subplot(2,3,5); imshow(gather(T(:,:,4:6,i))); subplot(2,3,6); imshow(gather(T(:,:,7:9,i)));

You can change the value of i in the above code to see different images in the current training batch. The figure will show you produced patches (first row) and the corresponding ground truth patches (second row). For non-graphical interface, you can edit your custom code here to save example patches periodically. Hint: you may need to use a persistent variable to control the process. Alternative solutions include using custom trianing loop.

2. PyTorch

Prerequisite

  1. Python 3.6

  2. pytorch (tested with 1.2.0 and 1.5.0)

  3. torchvision (tested with 0.4.0 and 0.6.0)

  4. cudatoolkit

  5. tensorboard (optional)

  6. numpy

  7. Pillow

  8. future

  9. tqdm

  10. matplotlib

  11. scipy

  12. scikit-learn

The code may work with library versions other than the specified.

Get Started

Demos:
  1. Run demo_single_image.py to process a single image. Example of applying AWB + different WB settings: python demo_single_image.py --input_image ../example_images/00.jpg --output_image ../result_images --show. This example should save the output image in ../result_images and output the following figure:

  1. Run demo_images.py to process image directory. Example: python demo_images.py --input_dir ../example_images/ --output_image ../result_images --task AWB. The available tasks are AWB, all, and editing. You can also specify the task in the demo_single_image.py demo.
Training Code:

Run training.py to start training. You should adjust training image directories before running the code.

Example: CUDA_VISIBLE_DEVICE=0 python train.py --training_dir ../dataset/ --fold 0 --epochs 500 --learning-rate-drop-period 50 --num_training_images 0. In this example, fold = 0 and num_training_images = 0 mean that the training will use all training data without fold cross-validation. If you would like to limit the number of training images to be n images, set num_training_images to n. If you would like to do 3-fold cross-validation, use fold = testing_fold. Then the code will train on the remaining folds and leave the selected fold for testing.

Other useful options include: --patches-per-image to select the number of random patches per image, --learning-rate-drop-period and --learning-rate-drop-factor to control the learning rate drop period and factor, respectively, and --patch-size to set the size of training patches. You can continue training from a training checkpoint .pth file using --load option.

If you have TensorBoard installed on your machine, run tensorboard --logdir ./runs after start training to check training progress and visualize samples of input/output patches.

Results

results

This software is provided for research purposes only and CAN NOT be used for commercial purposes.

Maintainer: Mahmoud Afifi ([email protected])

Related Research Projects

  • sRGB Image White Balancing:
    • When Color Constancy Goes Wrong: The first work for white-balancing camera-rendered sRGB images (CVPR 2019).
    • White-Balance Augmenter: Emulating white-balance effects for color augmentation; it improves the accuracy of image classification and image semantic segmentation methods (ICCV 2019).
    • Color Temperature Tuning: A camera pipeline that allows accurate post-capture white-balance editing (CIC best paper award, 2019).
    • Interactive White Balancing: Interactive sRGB image white balancing using polynomial correction mapping (CIC 2020).
  • Raw Image White Balancing:
    • APAP Bias Correction: A locally adaptive bias correction technique for illuminant estimation (JOSA A 2019).
    • SIIE: A sensor-independent deep learning framework for illumination estimation (BMVC 2019).
    • C5: A self-calibration method for cross-camera illuminant estimation (arXiv 2020).
  • Image Enhancement:
    • CIE XYZ Net: Image linearization for low-level computer vision tasks; e.g., denoising, deblurring, and image enhancement (arXiv 2020).
    • Exposure Correction: A coarse-to-fine deep learning model with adversarial training to correct badly-exposed photographs (CVPR 2021).
  • Image Manipulation:
    • MPB: Image blending using a two-stage Poisson blending (CVM 2016).
    • Image Recoloring: A fully automated image recoloring with no target/reference images (Eurographics 2019).
    • Image Relighting: Relighting using a uniformly-lit white-balanced version of input images (Runner-Up Award overall tracks of AIM 2020 challenge for image relighting, ECCV Workshops 2020).
    • HistoGAN: Controlling colors of GAN-generated images based on features derived directly from color histograms (CVPR 2021).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].