This is the pytorch implementation of our paper.
PyTorch 1.8
Compile functions for PSC layer:
cd exts
python setup.py install
Please download MIT, Kodak, and Mcm dataset. The structure of data directory:
└── datas
└── color
├── test
│ ├── filelist.txt
│ ├── hdrvdp
│ ├── kodak
│ ├── mcm
│ └── moire
├── train
│ ├── check.py
│ ├── filelist.txt
│ ├── hdrvdp
│ └── moire
└── val
├── hdrvdp
└── moire
Then pack images into lmdb files.
python create_lmdb.py
The config of different settings:
- DB.yaml (Demosaicing for Bayer CFA Pattern)
- DL.yaml (Demosaicing for 4x4 Learned CFA Pattern)
- DLN.yaml (Demosaicing for 4x4 Learned CFA Pattern with Noisy Data)
You can directly download the model I trained:
You can also train by yourself:
python train.py
Pay attention to the settings in the config file (e.g. gpu id).
With the trained model, you can test and save demosaiced results.
python test.py
If you find this work useful in your research, please consider citing:
@article{D3R,
author = {Tang, Jie and Li, Jian and Tan, Ping},
title = {Demosaicing by Differentiable Deep Restoration},
journal = {Applied Sciences},
volume = {11},
year = {2021},
number = {4},
article-number = {1649},
}