Skip to content

tgieruc/Noise2Noise_PyTorch

Repository files navigation

Noise2Noise, unofficial PyTorch implementation

Open In ColabPaper

This is a simple implementation of the Noise2Noise paper (Lehtinen et al., 2018). Trains a U-Net-style denoising network using pairs of noisy images — no clean targets needed.

Setup

This project uses uv for dependency management.

uv sync

Data

I used 32x32 images from ImageNet with random gaussian noise. The images are available in the form of pickle files for PyTorch. Pretrained weights are also available on this Drive.

Usage

Training

uv run n2n-train --train-data train_data.pkl --epochs 10

Options:

  • --batch-size — batch size (default: 8)
  • --lr — learning rate (default: 0.001)
  • --num-workers — data loading workers (default: 2)
  • --output — path to save model (default: model_pytorch.pth)
  • --pretrained — resume from pretrained weights

Inference

uv run n2n-predict --model model_pytorch.pth --input val_data.pkl

Options:

  • --output — save denoised images to a pickle file

Notebook

A demo Jupyter Notebook is also available: Open In Colab.

Tests

uv run python -m pytest tests/

Report

A full report on this implementation can be found here.

About

Unofficial implementation of Noise2Noise (Lehtinen et al., 2018) using PyTorch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors