All Projects → minhmanho → Deep_preset

minhmanho / Deep_preset

[WACV'21] Deep Preset: Blending and Retouching Photos with Color Style Transfer

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deep preset

Few Shot Patch Based Training
The official implementation of our SIGGRAPH 2020 paper Interactive Video Stylization Using Few-Shot Patch-Based Training
Stars: ✭ 313 (+979.31%)
Mutual labels:  style-transfer
Ebsynth
Fast Example-based Image Synthesis and Style Transfer
Stars: ✭ 554 (+1810.34%)
Mutual labels:  style-transfer
Data Augmentation Review
List of useful data augmentation resources. You will find here some not common techniques, libraries, links to github repos, papers and others.
Stars: ✭ 785 (+2606.9%)
Mutual labels:  style-transfer
Stylized Imagenet
Code to create Stylized-ImageNet, a stylized version of standard ImageNet (ICLR 2019 Oral)
Stars: ✭ 353 (+1117.24%)
Mutual labels:  style-transfer
Hidt
Official repository for the paper "High-Resolution Daytime Translation Without Domain Labels" (CVPR2020, Oral)
Stars: ✭ 513 (+1668.97%)
Mutual labels:  style-transfer
Tensorflow 101
TensorFlow 101: Introduction to Deep Learning for Python Within TensorFlow
Stars: ✭ 642 (+2113.79%)
Mutual labels:  style-transfer
Zhihu
This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
Stars: ✭ 3,307 (+11303.45%)
Mutual labels:  style-transfer
Style Transfer
Style Transfer - Alia Bhatt (Google Colab)
Stars: ✭ 26 (-10.34%)
Mutual labels:  style-transfer
Pytorch Adain
Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization' [Huang+, ICCV2017]
Stars: ✭ 550 (+1796.55%)
Mutual labels:  style-transfer
Landmark Detection
Four landmark detection algorithms, implemented in PyTorch.
Stars: ✭ 747 (+2475.86%)
Mutual labels:  style-transfer
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (+1324.14%)
Mutual labels:  style-transfer
Neural Style Pt
PyTorch implementation of neural style transfer algorithm
Stars: ✭ 456 (+1472.41%)
Mutual labels:  style-transfer
Stylized Neural Painting
Official Pytorch implementation of the preprint paper "Stylized Neural Painting", in CVPR 2021.
Stars: ✭ 663 (+2186.21%)
Mutual labels:  style-transfer
Mace Models
Mobile AI Compute Engine Model Zoo
Stars: ✭ 329 (+1034.48%)
Mutual labels:  style-transfer
Arbitrary Image Stylization Tfjs
Arbitrary style transfer using TensorFlow.js
Stars: ✭ 822 (+2734.48%)
Mutual labels:  style-transfer
Shapematchinggan
[ICCV 2019, Oral] Controllable Artistic Text Style Transfer via Shape-Matching GAN
Stars: ✭ 315 (+986.21%)
Mutual labels:  style-transfer
Deep Motion Editing
An end-to-end library for editing and rendering motion of 3D characters with deep learning [SIGGRAPH 2020]
Stars: ✭ 620 (+2037.93%)
Mutual labels:  style-transfer
Transferlearning
Transfer learning / domain adaptation / domain generalization / multi-task learning etc. Papers, codes, datasets, applications, tutorials.-迁移学习
Stars: ✭ 8,481 (+29144.83%)
Mutual labels:  style-transfer
Py Style Transfer
🎨 Artistic neural style transfer with tweaks (pytorch).
Stars: ✭ 23 (-20.69%)
Mutual labels:  style-transfer
Pytorch Multi Style Transfer
Neural Style and MSG-Net
Stars: ✭ 687 (+2268.97%)
Mutual labels:  style-transfer

Deep Preset: Blending and Retouching Photos with Color Style Transfer (WACV'2021)

[Page] [Paper] [SupDoc] [SupVid] [5-min Presentation] [Slides]

Man M. Ho, Jinjia Zhou

Alt Text

Prerequisites

  • Ubuntu 16.04
  • Pillow
  • PyTorch >= 1.1.0
  • Numpy
  • gdown (for fetching pretrained models)

Get Started

1. Clone this repo

git clone https://github.com/minhmanho/deep_preset.git
cd deep_preset

2. Fetch our trained model

Positive Pair-wise Loss (PPL) could improve Deep Preset in directly stylizing photos; however, it became worse in predicting preset, as described in our paper. Therefore, depending on your needs, please download Deep Preset with PPL for directly stylizing photos

./models/fetch_model_wPPL.sh

Or Deep Preset without PPL for preset prediction.

./models/fetch_model_woPPL.sh

Blending and Retouching Photos

Run our Deep Preset to stylize photos as:

CUDA_VISIBLE_DEVICES=0 python run.py \
    --content ./data/content/ \
    --style ./data/style/ \
    --out ./data/out/ \
    --ckpt ./models/dp_wPPL.pth.tar \
    --size 512x512 

Where --size is for the photo size [Width]x[Height], which should be divisible by 16. Besides, --size set as 352x352 will activate the preset prediction.

In case of only preset prediction needed, please add --p as:

CUDA_VISIBLE_DEVICES=0 python run.py \
    --content ./data/content/ \
    --style ./data/style/ \
    --out ./data/out/ \
    --ckpt ./models/dp_woPPL.pth.tar \
    --p

After processing, the predicted preset will be stored as a JSON file revealing how Lightroom settings are adjusted, as follows:

{
    "Highlights2012": -23,
    "Shadows2012": 4,
    "BlueHue": -8, 
    "Sharpness": 19, 
    "Clarity2012": -2
    ...
}

Cosplay Portraits

Alt Text Photos were taken by Do Khang (taking the subject in the top-left one) and the first author (others).

Regarding training data

I planned to share the dataset and Lightroom Add-ons publicly. However, I don't have much time for it these days. Uploading the whole dataset is inefficient since it is about ~500GB. You can download the training images with natural colors labeled as "0" at this Google Drive Afterward, you will need to script Lightroom (or create a Plugin/Add-ons) to generate other styles.

(You can refer to these ugly lines of code)

local catalog = LrApplication.activeCatalog()
local photos = catalog:getTargetPhotos()
local catalog_folder = LrPathUtils.parent(catalog:getPath())

pfolder = "<folder containing json presets>"
outfolder = "<out folder>"
for i=1,500,1 do
    pdir = pfolder .. tostring(i) .. ".json"
    local file = io.open(pdir, 'r')
    if file then
        local contents = file:read( "*a" )
        p = json.decode(contents);
        io.close( file )
    else
        p = nil
    end

    for j, photo in ipairs(photos) do
        catalog:withWriteAccessDo ("Apply preset", function()
            local tmp = LrApplication.addDevelopPresetForPlugin( _PLUGIN, "Preset " .. tostring(i), p)
            photo:applyDevelopPreset (tmp, _PLUGIN)
        end)
    end
    local _out = outfolder .. tostring(i)
    LrFileUtils.createDirectory(_out)
    exportImage.exportPhotos(photos, _out)

Please check Adobe Lightroom software development kit (SDK) for more details.

Citation

If you find this work useful, please consider citing:

@InProceedings{Ho_2021_WACV,
    author    = {Ho, Man M. and Zhou, Jinjia},
    title     = {Deep Preset: Blending and Retouching Photos With Color Style Transfer},
    booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
    month     = {January},
    year      = {2021},
    pages     = {2113-2121}
}

Acknowledgements

We would like to thank:

Liu, Hanxiao, Andrew Brock, Karen Simonyan, and Quoc V. Le. "Evolving Normalization-Activation Layers." 
arXiv preprint arXiv:2004.02967 (2020).
Zhang, Richard. "Making convolutional networks shift-invariant again." 
ICML (2019).

License

Our code and trained models are for non-commercial uses and research purposes only.

Contact

If you have any questions, feel free to contact me (maintainer) at [email protected]

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