Home

Awesome

DMENet: Deep Defocus Map Estimation Network<br><sub>Official Implementation of the CVPR 2021 Paper</sub><br><sub>Project | Paper | Supp | Poster</sub><br><sub><sub>License CC BY-NC</sub></sub>

This repository contains the official matlab implementation of SYNDOF generation used in the following paper:

Deep Defocus Map Estimation using Domain Adaptation<br> Junyong Lee<sup>1</sup>, Sungkil Lee<sup>2</sup>, Sunghyun Cho<sup>3</sup>, and Seungyong Lee<sup>1</sup><br> <sup>1</sup>POSTECH, <sup>2</sup>Sungkyunkwan University, <sup>3</sup>DGIST<br> IEEE Computer Vision and Pattern Recognition (CVPR) 2019<br>

<p align="left"> <a href="https://junyonglee.me/projects/DMENet"> <img width=85% src="./assets/teaser_DMENet.gif" /> </a> </p>

Getting Started

Prerequisites

Tested environment

Ubuntu Python 3.6 TensorFlow 1.15.0 TensorLayer 1.11.1 CUDA 10.0.130 CUDNN 7.6.

  1. Setup environment

    • Option 1. install from scratch

      $ git clone https://github.com/codeslake/DMENet.git
      $ cd DMENet
      
      # for CUDA10
      $ conda create -y --name DMENet python=3.6 && conda activate DMENet
      $ sh install_CUDA10.0.sh
      
      # for CUDA11 (the name of conda environment matters)
      $ conda create -y --name DMENet_CUDA11 python=3.6 && conda activate DMENet_CUDA11
      $ sh install_CUDA11.1.sh
      
    • Option 2. docker

      $ nvidia-docker run --privileged --gpus=all -it --name DMENet --rm codeslake/dmenet:CVPR2019 /bin/zsh
      $ git clone https://github.com/codeslake/DMENet.git
      $ cd DMENet
      
      # for CUDA10
      $ conda activate DMENet
      
      # for CUDA11
      $ conda activate DMENet_CUDA11
      
  2. Download and unzip datasets (OneDrive | Dropbox) under [DATASET_ROOT].

    [DATASET_ROOT]
     ├── train
     │   ├── SYNDOF
     │   ├── CUHK
     │   └── Flickr
     └── test
         ├── CUHK
         ├── RTF
         └── SYNDOF
    

    Note:

    • [DATASET_ROOT] is currently set to ./datasets/. It can be specified by modifying config.data_offset in ./config.py.
  3. Download pretrained weights of DMENet (OneDrive | Dropbox) and unzip it as in [LOG_ROOT]/DMENet_CVPR2019/DMENet_BDCS/checkpoint/DMENet_BDCS.npz ([LOG_ROOT] is currently set to ./logs/).

  4. Download pretrained VGG19 weights (OneDrive | Dropbox) and unzip as in pretrained/vgg19.npy (for training only).

Logs

Testing final model of CVPR 2019

Please note that due to the server issue, the checkpoint used for the paper is lost. <br/>The provided checkpoint is the new checkpoint that shows the closest evaluation results as in the paper.

Check out updated performance with the new checkpoint.

Training & testing the network

Contact

Open an issue for any inquiries. You may also have contact with junyonglee@postech.ac.kr

Related Links

License

License CC BY-NC<br> This software is being made available under the terms in the LICENSE file. Any exemptions to these terms require a license from the Pohang University of Science and Technology.

Citation

If you find this code useful, please consider citing:

@InProceedings{Lee2019DMENet,
    author    = {Junyong Lee and Sungkil Lee and Sunghyun Cho and Seungyong Lee},
    title     = {Deep Defocus Map Estimation Using Domain Adaptation},
    booktitle = {Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2019}
}