GithubHelp home page GithubHelp logo

jackzhousz / deepselfie Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ycl92/deepselfie

0.0 0.0 0.0 172.78 MB

DeepSelfie: Single-Shot Low-Light Enhancement for Selfies

License: MIT License

Python 23.97% Jupyter Notebook 76.03%

deepselfie's Introduction

DeepSelfie: Single-shot Low-light Enhancement for Selfies

If you are interested in using our code and find it useful in your research, please consider citing the following paper:

@article{article,
author = {Lu, Yucheng and Kim, Dong-Wook and Jung, Seung-Won},
year = {2020},
month = {07},
pages = {1-1},
title = {DeepSelfie: Single-shot Low-light Enhancement for Selfies},
volume = {PP},
journal = {IEEE Access},
doi = {10.1109/ACCESS.2020.3006525}
}

System Requirements

  • python 3
  • pyTorch
  • torchvision
  • Jupyter Notebook (for training)
  • Visdom (for training)
  • OpenCV (for training)
  • numpy
  • build-essential: sudo apt-get install build-essential
  • python-all-dev: sudo apt-get install python-all-dev
  • libexiv2-dev: sudo apt-get install libexiv2-dev
  • libboost-python-dev: sudo apt-get install libboost-python-dev
  • pyexiv2: pip install py3exiv2
  • libraw: sudo apt-get install libraw-dev
  • rawpy: pip install rawpy

Please note that the libraw installed via apt-get is an outdated version, if you get wrong results caused by this version, you should better build it from source.

Run Demo

To run demo, download the pretrained models from onedrive, unzip and copy the files to "saves" folder, add your .DNG files to "samples" folder, then run the following command:

python ./demo.py

The generated images will be saved to "results" folder.

Alternatively, you can specify your own input or output path by passing "--input" and "--output":

python ./demo.py --input PATH-TO-INPUT-FOLDER --output PATH-TO-OUTPUT-FOLDER

The default device used for running this demo is CPU, if you want to use GPU instead, pass "--device cuda":

python ./demo.py --device cuda

If you encounter out of memory error, try down-sampling the input before further processing:

python ./demo.py --resize (600,800)

The output images are not calibrated and thus have distortion, if you want to do camera calibration, pass "--calib":

python ./demo.py --calib

Train from scratch

Before training from scratch, you need to first download the FivekNight dataset from onedrive. Also, you need to use your camera to take some images (the more the better, with various exposure levels and ISO) in RAW format. To start training, follow the instructions below:

  1. Generate training dataset for r2rNet by running "genDB-r2rNet.ipynb" under /dataset.
  2. Get the statistical information of your own dataset by running "getStat_r2rNet.ipynb" under /dataset, copy the results to "config.ipynb" under /.
  3. Train r2rNet by running "train-dataloader.ipynb" under /, you may want to specify a new port for Visdom.
  4. Generate validation dataset by running "genValset.ipynb" under /, this step should be performed after r2rNet training is completed.
  5. Train the gain estimation network by running "train-gainEst.ipynb" under /, you may want to specify a new port for Visdom.
  6. Train the raw processing network by running "train-rawProcess.ipynb" under /, you may want to specify a new port for Visdom.

Note: You may need to change the paths at step 1 and 2, and the port used by Visdom at step 3, 5, and 6.

deepselfie's People

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.