Image as an IMU: Estimating Camera Motion from a Single Motion-Blurred Image
Image as an IMU: Estimating Camera Motion from a Single Motion-Blurred Image
Official implementation of Image as an IMU: Estimating Camera Motion from a Single Motion-Blurred Image, ICCV 2025 (Oral).
@inproceedings{chen2025imageimu,
title={Image as an IMU: Estimating Camera Motion from a Single Motion-Blurred Image},
author={Chen, Jerred and Clark, Ronald},
booktitle={International Conference of Computer Vision (ICCV)},
year={2025}
}First, create a new conda environment.
conda create -n image-as-imu python=3.10
conda activate image-as-imuThen, clone the repo and install the dependencies.
git clone https://github.com/jerredchen/image-as-an-imu.git
cd image-as-an-imu
pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txtFinally, install the iaai module.
pip install -e .Download the model weights:
| Backbone | Checkpoint |
|---|---|
| SegNeXt | Download |
To run a minimal example, we provide run.py which takes in a single motion-blurred image and estimates the velocity, given the known focal length and exposure time.
…We show how to use our model on a custom StrayScanner recorded sequence, which you can download on iPhone 12 Pro or later Pro models and iPad 2020 Pro or later Pro models. After recording and downloading the sequence, you can process it using process_strayscanner_seq.py and specifying your arguments in process_strayscanner_cfg.yaml. Then, run run_custom_strayscanner_seq.py given your sequence path in run_strayscanner_cfg.yaml.
Note that the StrayScanner app does not currently support accessing the exposure time of the camera. However, in normal lighting conditions you may assume that the exposure time is typically around 0.01 seconds.
We include scripts for evaluating all of our baselines. To evaluate the baselines, follow the installation instructions for hloc, MASt3R, DROID-SLAM, as well as evo. Then, run the respective evaluation script given the specified sequence path in the config. In each config, you may optionally save the velocity outputs of a baseline to be saved to the sequence directory, which can be reused instead of rerunning the method. Download the test sequences used in our paper evaluation here. We slightly modified the StrayScanner app to access the exposure time through the ARKit API.
We provide the script for generating the synthetically rendered motion-blurred images. To run this, download ScanNet++, which requires submitting an application. You will also need to follow the installation instructions for RIFE and PromptDA. Then, run synth_data_gen.py with the config synth_data_gen_cfg.yaml. This will generate a CSV file with the paths to load the motion-blurred images, flows, depths, as well as the relative camera pose across the image.
If you wish to train the model from scratch, please also see the synthetic data generation instructions above. You will need to also download the ImageNet-pretrained SegNeXt weights mscan_b.pth from here.
To train the model, run train.py with the desired arguments/hyperparameters in train/configs/train_cfg.yaml. As mentioned in our paper, we train the model in three stages:
MODEL.POSE_HEAD.SUPERVISION=false.MODEL.POSE_HEAD.SUPERVISION=true.MODEL.POSE_HEAD.SUPERVISION=true, TRAINING.POSE_ONLY=true and TRAINING.USE_PSEUDO_GT=true, which prevent the flow and depth predictions from deviating too far from the original outputs. Run generate_pseudo_gt.py to generate the pseudo ground-truth labels.We provide the hyperparameters that we use for all three stages in separate files. However, we only use the file train/configs/train_cfg.yaml when actually training the model, so the desired hyperparameters can be changed in train_cfg.yaml or in the command line.
No open issues yet, or sync has not completed.