chensong1995 / E-CIR

Event-Enhanced Continuous Intensity Recovery (CVPR 2022)
MIT License
42 stars 2 forks source link

E-CIR: Event-Enhanced Continuous Intensity Recovery

This repository contains authors' implementation of E-CIR: Event-Enhanced Continuous Intensity Recovery. Our implementation uses the PyTorch library. We warmly welcome any discussions related to our implementation and our paper. Please feel free to open an issue.

Introduction

E-CIR consists of an initialization module and a refinement module. The initialization module regresses the polynomial coefficients from the events and the blurry frame. The refinement module further polishes the frame quality by encouraging visual features to propagate across consecutive frames. Approach overview Result Animation

Environment set-up

Please install Anaconda first and execute the following commands:

conda create -y --name e-cir python==3.8.11
conda install -y -q --name e-cir -c pytorch -c conda-forge --file requirements.txt
conda activate e-cir

Dataset set-up

We experimented E-CIR on the REDS dataset and seven real event captures in EDI. Please refer to REDS_Dataset.md and EDI_Dataset.md for instructions on how to set up these two datasets.

Training

Please set the arguments in src/main_reds.py and run:

python src/main_reds.py

Pre-trained weights

You can download our pre-trained weights here: Google Drive.

After downloading the weights, move them accordingly so that the directory structure looks like this:

<project root>
  |-- data
  |     |-- <data files>
  |-- lib
  |     |-- <source files>
  |-- src
  |     |-- <source files>
  |-- trainers
  |     |-- <source files>
  |-- saved_weights
  |     |-- release
  |     |     |-- checkpoints
  |     |     |     |-- 49
  |     |     |     |    | model_g.pth
  |     |     |     |    | model_r.pth
  |     |     |     |    | optimizer_g.pth
  |     |     |-- log
  |     |     |     |-- events.out.tfevents.1634957528.dgx-4.78772.0

Evaluation

To evaluate the MSE, PSNR, and SSIM on the REDS dataset, please run:

python src/main_reds.py --load_dir saved_weights/release/checkpoints/49 --save_dir saved_weights/release

This saves the output images to saved_weights/release/reds_output and prints quantitative results to stdout.