File size: 2,075 Bytes
f0afbf9
ef5733d
 
8a037d3
fc74e43
 
41b0f5e
3470ec3
8a037d3
 
41b0f5e
3470ec3
f0afbf9
 
ef5733d
 
3470ec3
ef5733d
3470ec3
ef5733d
3470ec3
ef5733d
 
 
bd8e677
 
ef5733d
bd8e677
ef5733d
 
bd8e677
 
ef5733d
 
bd8e677
ef5733d
 
3470ec3
ef5733d
 
bd8e677
 
 
 
41b0f5e
 
 
 
 
 
 
 
 
 
 
8a037d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
language:
- en
license: bsd-3-clause
tags:
- arxiv:2506.23151
- optical-flow-estimation
- optical-flow
pipeline_tag: image-to-image
library_name: pytorch
base_model:
- egorchistov/optical-flow-MEMFOF-Tartan-T-TSKH
---

# MEMFOF-Tartan-T-TSKH-spring

<a href="https://arxiv.org/abs/2506.23151" style="text-decoration: none;">πŸ“„ Paper</a> | <a href="https://msu-video-group.github.io/memfof" style="text-decoration: none;">🌐 Project Page</a> | <a href="https://github.com/msu-video-group/memfof" style="text-decoration: none;">πŸ’» Code</a> | <a href="https://colab.research.google.com/github/msu-video-group/memfof/blob/dev/demo.ipynb" style="text-decoration: none;">πŸš€ Colab</a> | <a href="https://huggingface.co/spaces/egorchistov/optical-flow-MEMFOF" style="text-decoration: none;">πŸ€— Demo</a>

πŸ” **MEMFOF** is a **memory-efficient optical flow method** for **Full HD video** that combines **high accuracy** with **low VRAM usage**.

βœ… **Note:** This particular checkpoint is intended for submission to **Spring benchmark**.

## πŸ› οΈ Usage

Install MEMFOF via the package manager:

```shell
pip3 install git+https://github.com/msu-video-group/memfof
```

Then use the following snippet to compute backward and forward optical flow for three consecutive frames:

```python
import torch
from memfof import MEMFOF

device = "cuda" if torch.cuda.is_available() else "cpu"
model = MEMFOF.from_pretrained("egorchistov/optical-flow-MEMFOF-Tartan-T-TSKH-spring").eval().to(device)

with torch.inference_mode():
    # [B=1, T=3, C=3, H=1080, W=1920]
    example_input = torch.randint(0, 256, [1, 3, 3, 1080, 1920], device=device)
    # [B=1, C=2, H=1080, W=1920]
    backward_flow, forward_flow = model(example_input)["flow"][-1].unbind(dim=1)
```

## πŸ“š Citation

```
@article{bargatin2025memfof,
  title={MEMFOF: High-Resolution Training for Memory-Efficient Multi-Frame Optical Flow Estimation},
  author={Bargatin, Vladislav and Chistov, Egor and Yakovenko, Alexander and Vatolin, Dmitriy},
  journal={arXiv preprint arXiv:2506.23151},
  year={2025}
}
```