Instructions to use ziyiwang/StableMotion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ziyiwang/StableMotion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ziyiwang/StableMotion", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Ziyi Wang commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model:
|
| 4 |
+
- stabilityai/stable-diffusion-2
|
| 5 |
+
---
|
| 6 |
+
# StableMotion: Repurposing Diffusion-Based Image Priors for Motion Estimation
|
| 7 |
+
This is the official repo for paper [StableMotion: Repurposing Diffusion-Based Image Priors for Motion Estimation](https://www.arxiv.org/abs/2505.06668)
|
| 8 |
+
|
| 9 |
+
## Setup
|
| 10 |
+
0. Clone the [code repo](https://github.com/ziyiwhat/StableMotion).
|
| 11 |
+
1. Create your environment from `requirements.txt`.
|
| 12 |
+
2. Download [DIR-D](https://drive.google.com/file/d/1KR5DtekPJin3bmQPlTGP4wbM1zFR80ak/view?usp=sharing) and [RS-Real](https://huggingface.co/datasets/Yzl-code/RS-Diffusion/tree/main). Put them into `StableMotion_SIR` and `StableMotion_RSC` respectively.
|
| 13 |
+
|
| 14 |
+
## StableMotion for Stitched Image Rectangling (SIR)
|
| 15 |
+
### Inference
|
| 16 |
+
0. Download the checkpoints of "StableMotion_SIR"
|
| 17 |
+
1. Run "cd StableMotion_SIR && sh sample.sh". You may want to change this file to modify the inference configurations.
|
| 18 |
+
2. Run "sh metrics.sh" to evaluate the results.
|
| 19 |
+
|
| 20 |
+
### Training
|
| 21 |
+
0. Replicate [RecDiffusion](https://github.com/lhaippp/RecDiffusion) to get pseudo labels, i.e., the flow labels generated by [RecDiffusion](https://github.com/lhaippp/RecDiffusion) on the training set of [DIR-D](https://drive.google.com/file/d/1KR5DtekPJin3bmQPlTGP4wbM1zFR80ak/view?usp=sharing). Put and rename it into `StableMotion_SIR/MDM_Flow`.
|
| 22 |
+
1. Run "cd StableMotion_SIR && sh train.sh". You may want to change this file to modify the training configurations. The default configuration requires approximately 80 GB of VRAM per card.
|
| 23 |
+
|
| 24 |
+
## StableMotion for Rolling Shutter Correction (RSC)
|
| 25 |
+
### Inference
|
| 26 |
+
0. Download the checkpoints of "StableMotion_RSC"
|
| 27 |
+
1. Run "cd StableMotion_RSC && sh sample.sh". You may want to change this file to modify the inference configurations.
|
| 28 |
+
2. Run "sh metrics.sh" to evaluate the results.
|
| 29 |
+
|
| 30 |
+
### Training
|
| 31 |
+
Run "cd StableMotion_RSC && sh train.sh". You may want to change this file to modify the training configurations. The default configuration requires approximately 40 GB of VRAM per card.
|