Code Monkey home page Code Monkey logo

drn's Introduction

Learning Deep Representations for Photo Retouching

By Di Li, and Susanto Rahardja

Introduction

The codebase provides the official PyTorch implementation for the paper " Learning Deep Representations for Photo Retouching" (accepted by IEEE Transactions on Multimedia).

In this project, we present a a novel framework to retouch the degraded photos towards a specific photographic style in an unsupervised fashion. To be specific, we unify the design philosophy of the generator and the discriminator into a multi-scale form and reuse these powerful networks as feature extractors to obtain deep latent representations of the photos with varying scales. Then, we employed projection heads to map these deep representations to a neater loss space for evaluation. In particular, we utilized a contrastive scheme for generator to keep the content consistency and a cross entropy scheme for discriminator to improve the aesthetic quality. Powered by this simple yet efficient design philosophy, our algorithm surpasses previous algorithms on two well known datasets with photo enhancement task. As a learning framework compliable with various enhancement networks, our algorithm shows great potential to be a practical tool to efficiently and effectively build photo retouching systems with different needs.

Dependencies

Datasets

The paper use the FiveK and HDR+ datasets for experiments.

  • FiveK : You can download the original FiveK dataset from the dataset homepage and then process images using Adobe Lightroom.

    • To generate the input images, in the Collections list, select the collection Input with Daylight WhiteBalance minus 1.5.
    • To generate the target images, in the Collections list, select the collection Experts/C.
    • All the images are converted to .PNG format.
  • HDR+ : You can download the original HDR+ dataset from the dataset homepage and then process images using rawpy.

    • To generate the input images, using raw.postprocess() function, set use_camera_wb=True and fbdd_noise_reduction=rawpy.FBDDNoiseReductionMode.Full.

The final directory structure is as follows.

./data/FiveK
    trainA/         # 8-bit sRGB train inputs
    trainB/         # 8-bit sRGB train groundtruth
    testA/          # 8-bit sRGB test inputs
    testB/          # 8-bit sRGB test groundtruth

Train

  • run visdom to monitor status
visdom
  • run
python train.py --name DRN --dataroot ./data/FiveK --batch_size 2 --gpu_ids 0 --netG rdnccut --model cut --lambda_NCE 10 --nce_includes_all_negatives_from_minibatch --ndf 32 --netD fe --niter 20 --niter_decay 80 --spectral_norm

Test

  • run
python test.py --dataroot ./data/FiveK/testA --name DRN --gpu_ids 0 --netG rdnccut 

Citation

If you find this repository useful, please kindly consider citing the following paper:

@article{li2023learning,
title={Learning Deep Representations for Photo Retouching},
author={Li, Di and Rahardja, Susanto},
journal={IEEE Transactions on Multimedia},
year={2023},
publisher={IEEE}
}

License

Our project is licensed under a MIT License.

drn's People

Contributors

xslidi avatar

Stargazers

Rohan Bharadwaj avatar Khoi Pham avatar Jonathan Fischoff avatar  avatar Salih AYDIN 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.