← 开源
mahmoudnafifi

Deep_White_Balance

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

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.2%
625
Star
74
Fork
+-1
本周
1
贡献者
创建于 2020-04-19 · 更新于 2026-10-16 · 今日第 6575 名
主要开发者
mahmoudnafifi

mahmoudnafifi/Deep_White_Balance 排名第 6,575,有 625 个星标。

同类别比较

mahmoudnafifi/Deep_White_Balance 排名第 6,575,此处有 8 个同类条目;f-dangel/backpack 排名第 6,590。

同类别比较
名称排名指标
sooftware/kospeech6,545
语言:
Python
星标数:
637
分叉数:
186
简介:
Open-Source Toolkit for End-to-End Korean Automatic Speech Recognition leveraging PyTorch and Hydra.
WwZzz/easyFL6,546
语言:
Jupyter Notebook
星标数:
636
分叉数:
104
简介:
An experimental platform for federated learning.
Teddy-Liao/walk-these-ways-go26,554
语言:
C++
星标数:
633
分叉数:
70
简介:
Deploy walk-these-ways project on Unitree Go2
vikashplus/robohive6,557
语言:
Python
星标数:
633
分叉数:
99
简介:
A unified framework for robot learning
f-dangel/backpack6,590
语言:
Python
星标数:
618
分叉数:
57
简介:
BackPACK - a backpropagation package built on top of PyTorch which efficiently computes quantities other than the gradient.
SciSharp/Keras.NET6,592
语言:
C#
星标数:
617
分叉数:
129
简介:
Keras.NET is a high-level neural networks API for C# and F#, with Python Binding and capable of running on top of TensorFlow, CNTK, or Theano.
pal-robotics/aruco_ros6,606
语言:
C++
星标数:
611
分叉数:
339
简介:
Software package and ROS wrappers of the Aruco Augmented Reality marker detector library
NJU-3DV/SpatialVID6,616
语言:
Python
星标数:
607
分叉数:
20
简介:
[CVPR 2026] SpatialVID: A Large-Scale Video Dataset with Spatial Annotations
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词Computer vision
星标数625
分叉数74
贡献者1
创建日期2020-04-19
更新日期2026-10-16
1 天星标数1
7 天星标数-1
排名6,575
上次排名15,713
排名变化9,138
7 天星标排名17,827
上次 7 天星标排名18,408
7 天星标排名变化581
总星标排名16,254
上次总星标排名16,260
总星标排名变化6
README 摘录

Deep White-Balance Editing, CVPR 2020 (Oral) *Mahmoud Afifi* 1,2 and *Michael S. Brown* 1 1 Samsung AI Center (SAIC) - Toronto 2 York University Oral presentation Reference code for the paper Deep White-Balance Editing. If you use this code or our dataset, please cite our paper: Training data 1. 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: and the

corresponding ground truth image: . This is the same filename style used in the Rendered WB dataset. As an example, please refer to directory. Code We provide source code for Matlab and PyTorch platforms. *There is no guarantee that the trained models produce exactly the same results. Deep Learning Toolbox Get Started Run Demos: 1. Run or to process a single image or image directory, respectively. The available tasks are AWB, all, and editing. m, it should save the result in

and output the following figure: 2. You should adjust training image directories from the variable before running the code. You can change the training settings in before training. For example, you can use and variables to change the number of training epochs and mini-batch size, respectively. If you set and , the training will use all training data without fold cross-validation. If you would like to limit the number of training images to be images, set to . If you

would like to do 3-fold cross-validation, use . Then the code will train on the remaining folds and leave the selected fold for testing. Other useful options include: to select the number of random patches per image and to set the size of training patches. To control the learning rate drop rate and factor, please check the function located in the directory. You can use the variable to continue training from a training checkpoint file. Once training started, a

file will be created in the 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: You can change the value of 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. scikit-learn The code may work with library versions other than the specified. Example of applying AWB + different WB settings: . This example should save the output image in and output the following figure: 2. The available tasks are AWB

, all, and editing. You can also specify the task in the demo. You should adjust training image directories before running

常见问题

记录了多少星标和分叉?

mahmoudnafifi/Deep_White_Balance 有 625 个星标和 74 个分叉。

仓库排名是多少?

mahmoudnafifi/Deep_White_Balance 排名第 6,575。

记录的语言和类别是什么?

mahmoudnafifi/Deep_White_Balance 有 625 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

mahmoudnafifi/Deep_White_Balance 与 f-dangel/backpack 比较,后者排名第 6,590,有 618 个星标。

README

Deep White-Balance Editing, CVPR 2020 (Oral)

*Mahmoud Afifi*1,2 and *Michael S. Brown*1

1Samsung AI Center (SAIC) - Toronto

2York University

Oral presentation

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}
}

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:

  2. 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:

  2. Run demo_images.py to process image directory. Example: python demo_images.py --input_dir ../example_images/ --output_dir ../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

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

Maintainer: Mahmoud Afifi (m.3afifi@gmail.com)

Related Research Projects

  • When Color Constancy Goes Wrong: The first work to directly address the problem of incorrectly white-balanced images; requires a small memory overhead and it is fast (CVPR 2019).
  • White-Balance Augmenter: An augmentation technique based on camera WB errors (ICCV 2019).
  • Interactive White Balancing:A simple method to link the nonlinear white-balance correction to the user's selected colors to allow interactive white-balance manipulation (CIC 2020).
  • Exposure Correction: A single coarse-to-fine deep learning model with adversarial training to correct both over- and under-exposed photographs (CVPR 2021).
排名相邻
同类项目