Home

Awesome

Motion-ETR (official pytorch implementation)

[paper] [video]

This repository provides the official PyTorch implementation of the paper accepted in TPAMI:

Exposure Trajectory Recovery from Motion Blur

Youjian Zhang, Chaoyue Wang, Stephen J. Maybank, Dacheng Tao

Abstract: Motion blur in dynamic scenes is an important yet challenging research topic. Recently, deep learning methods have achieved impressive performance for dynamic scene deblurring. However, the motion information contained in a blurry image has yet to be fully explored and accurately formulated because: (i) the ground truth of dynamic motion is difficult to obtain; (ii) the temporal ordering is destroyed during the exposure; and (iii) the motion estimation from a blurry image is highly ill-posed. By revisiting the principle of camera exposure, motion blur can be described by the relative motions of sharp content with respect to each exposed position. In this paper, we define exposure trajectories, which represent the motion information contained in a blurry image and explain the causes of motion blur. A novel motion offset estimation framework is proposed to model pixel-wise displacements of the latent sharp image at multiple timepoints. Under mild constraints, our method can recover dense, (non-)linear exposure trajectories, which significantly reduce temporal disorder and ill-posed problems. Finally, experiments demonstrate that the recovered exposure trajectories not only capture accurate and interpretable motion information from a blurry image, but also benefit motion-aware image deblurring and warping-based video extraction tasks.

<img src= "https://github.com/yjzhang96/Motion-ETR/blob/main/pics/reblur_pipeline.png" width="90%">

Contents

The contents of this repository are as follows:

  1. Prerequisites
  2. Dataset
  3. Train
  4. Test
  5. Performance
  6. Model

Prerequisites

Dataset

Download GoPro datasets and algin the blurry/sharp image pairs. Organize the dataset in the following form:

|- Gopro_align_data 
|   |- train  % 2103 image pairs
|   |   |- GOPR0372_07_00_000047.png
|   |   |- ...
|   |- test   % 1111 image pairs
|   |   |- GOPR0384_11_00_000001.png
|   |   |- ...

Training

sh run_train.sh

Note that you can replace the argument offset_mode from lin/bilin/quad to decide the constraint of the estimated trajectory as linear/bi-linear/quadratic

Test

sh run_test.sh

Performance

We provide some examples of our quadratic exposure trajectory and the cooresponding reblurred images.

<img src= "https://github.com/yjzhang96/Motion-ETR/blob/main/pics/eg_exposure_trajectory.png" width="90%">

Model

We have put the pretrained quadratic model in directory ./pretrain_models/MTR_Gopro_quad, and we will provide other models which mentioned in the paper in the Google drive.

ModelZero constraintLinearBi-linearQuadratic
PSNR35.8233.4533.7934.68
SSIM0.98000.96690.96870.9740

Also, we provide our pretrained motion-aware deblurring model.