Sitelet https://github.com/Klawens/DDP-Net
Skip to content
KlawensPublic

About

Denoising-Deived-Prior for Demosaicking.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

DDP-Net

Official code for Denoising-Derived Priors for Faithful Bayer RAW Demosaicking.

DDP-Net jointly predicts reference-aligned denoised Bayer mosaics and a clean sRGB image from a noisy RAW burst.

Paper configuration

The default configuration is configs/ddpnet_sidd_b.conf:

Setting Value
Burst length 10 frames
Crop size 720 × 720
Batch size 1 burst
Optimizer AdamW
Initial learning rate 5 × 10⁻⁵
Schedule Cosine annealing
Training length 250 epochs
RAW loss weight 15
RGB loss weight 10
CRG temperature scale α 0.05

Repository layout

.
├── configs/
│   ├── configspec.conf
│   └── ddpnet_sidd_b.conf
├── data/
│   └── sidd_b_val_crops.csv
├── models/
│   ├── bayer_denoiser.py
│   ├── blocks.py
│   ├── crg.py
│   ├── ddpnet.py
│   └── raw_alignment.py
├── utils/
│   ├── data.py
│   ├── loss.py
│   └── train_utils.py
├── train.py
├── test.py
└── requirements.txt

Environment

The paper uses Python/PyTorch 2.5.1 with CUDA 12.4. A clean environment can be created with:

conda create -n ddpnet python=3.10 -y
conda activate ddpnet
pip install -r requirements.txt

SIDD-Burst preparation

Download the public SIDD-Medium RAW and sRGB training data from the official SIDD source. SIDD images are not redistributed here.

Arrange the public files as follows:

datasets/
├── SIDD_Medium_Raw/
│   ├── Data/
│   │   └── <scene-instance>/
│   │       ├── *_NOISY_RAW_010.MAT
│   │       ├── *_GT_RAW_010.MAT
│   │       └── ...
│   └── nlf.csv
└── SIDD_Medium_Srgb/
    └── Data/
        └── <scene-instance>/
            ├── *_GT_SRGB_010.PNG
            └── ...

nlf.csv contains the per-channel noise-level-function parameters from the public SIDD metadata:

scene_instance_id,beta1_r,beta1_g,beta1_b,beta2_r,beta2_g,beta2_b

The release includes only data/sidd_b_val_crops.csv: the exact crop coordinates used by the current validation protocol.

The crop manifest columns are:

Column Meaning
scene_id SIDD scene-instance directory
pair_id Pair identifier, such as 010 or 011
crop_id Crop index within the pair
x, y Top-left coordinate in the RGGB-normalized mosaic
width, height Crop dimensions; 720 × 720 in this release

Training

Run commands from the repository root:

python train.py \
  --config configs/ddpnet_sidd_b.conf \
  --device cuda

Resume from a saved checkpoint:

python train.py \
  --config configs/ddpnet_sidd_b.conf \
  --resume runs/ddpnet_sidd_b/checkpoints/final.pth \
  --device cuda

Checkpoints are written to runs/ddpnet_sidd_b/checkpoints/; validation metrics are written to runs/ddpnet_sidd_b/logs/metrics.csv.

Testing

python test.py \
  --config configs/ddpnet_sidd_b.conf \
  --checkpoint runs/ddpnet_sidd_b/checkpoints/best_rgb_psnr.pth \
  --device cuda

Add --save-images to save restored RGB and RAW outputs. The aggregate RGB and RAW PSNR/SSIM values are saved as metrics.json under runs/ddpnet_sidd_b/results/.

About

Denoising-Deived-Prior for Demosaicking.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages