Models · Frame interpolation

EMA-VFI

EMA-VFI (Zhang et al., CVPR 2023; large and small, for the middle frame or any time): makes the frame between two video frames from motion and appearance features that inter-frame attention extracts together, for slow motion and higher frame rates. Apache-2.0 code and weights.

experimental Fork of MCG-NJU/EMA-VFI@75b6f6a · backends: portable, kernels

Checkpoint

Paper 2023 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 207 ms 1080x1920, fp16
vs the faster original 1.4× original fp16: 296 ms
Peak memory 368 MiB original: 3,940 MiB
Accuracy vs original fp32 ±0.00 kernels psnr, DAVIS 2017 480p (27.67 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import interpolation

model = interpolation.load("ema-vfi")  # kernels on a supported GPU, else portable PyTorch
result = model(frame1, frame2)
result.frame
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench ema-vfi

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16torch.autocast(float16) around the call; upstream MultiScaleFlow as Model.inference (no TTA), timestep 0.5, BGR, replicate pad to 32fp16 296–3,940 MiB/4,290 MiB1.20.34
Portable fp32fp32not measured ––––
Portablefp16 2331.3×2,827 MiB/3,184 MiB0.80.23
Kernelsfp16 2071.4×368 MiB/3,566 MiB0.80.21
Portable + torch.compile 1651.8×3,325 MiB/3,542 MiB91 (build)–
TensorRT fp16fp16 1242.4×1,426 MiBenginenot comparable91 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp3236849 10.4 GiB process–1080x1920
Portablefp161981 6,883 MiB processmatches1080x1920
Portablefp3219632 11.3 GiB processmatches1080x1920
Kernelsfp16not implemented–1080x1920

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
Training data

Our reading of the licences, not legal advice.

Weights

ema-vfi-ours.pkl 264 MB· hosted on Google Drive

fastforks downloads and checks these files on first use (fastforks download ema-vfi).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

DAVIS 2017 480p

2 frame triplets per video (180), PSNR / SSIM

Rundtypepsnr ↑ssim ↑Δ psnr vs fp32 originaltripletsms / triplet
Original fp32fp3227.670.8119 reference 180 –
Original fp16fp1627.670.8119 ±0.00 180 –
Portable fp32not measured
Portablefp1627.670.8119 ±0.00 180 –
Kernelsfp1627.670.8119 ±0.00 180 –

DAVIS 2017 trainval 480p (JPEG), frames 0 / 2 and 20 / 22 of each of the 90 videos give the frame 1 / 21 at time 0.5, compared with the real one: PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) of the output rounded to uint8, on RGB in [0, 1], averaged over the triplets for the 180-triplet benchmark. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks d199e94c, 2026-11-14.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.001 and p99 <= 0.005 (absolute error of the output frame).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.00005 not recorded
GPU default dtypes, mean |diff|≤ 0.001 0.00018
GPU default dtypes, p99 |diff|≤ 0.005 0.00062

Recorded for ema-vfi on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14, with these kernels: cudnn_hacc

Details

EMA-VFI (Zhang et al., CVPR 2023): video frame interpolation with inter-frame attention. A hybrid CNN and Transformer backbone; in its two window-attention stages (1/16 and 1/32 of the image) each frame attends to the other, and the attention map gives both the appearance features and motion features (the attention-weighted pixel offsets). Two heads estimate the flow to both frames and a fusion mask, a U-Net refines the blend of both warped frames. `ema-vfi` and `ema-vfi-small` are trained for the middle frame, `ema-vfi-t` and `ema-vfi-small-t` for any time in [0, 1].

Input / output
Input: two RGB images (consecutive frames). Output: the frame between them at timestep (0.5 by default; 0 = the first, 1 = the second), RGB in [0, 1].
Input size
any H x W >= 32, padded to a multiple of 32; tested up to 1988x2880 (7,625 MiB allocated)
Options
  • cuda_graphs=true
  • tta=false· changes the output
Outputs
frame
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16

Limitations

  • Kernels keep CUDA graphs: their private pool and static outputs stay reserved, so peak reserved is ~670 (480x854) / 3200 (1080x1920) MiB above portable (peak allocated is not); `cuda_graphs=false` or `release_graphs()` frees it.
Full reference, generated from the repository

EMA-VFI (Zhang et al., CVPR 2023; large and small, for the middle frame or any time): makes the frame between two video frames from motion and appearance features that inter-frame attention extracts together, for slow motion and higher frame rates. Apache-2.0 code and weights.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
ema-vfisynthetic (1080x1920)original
portable
kernels
portable + torch.compile
TensorRT fp16
296
233
207
165
124
3940 / 4290
2827 / 3184
368 / 3566
3325 / 3542
1719 / 1786
ema-vfi-smallsynthetic (1080x1920)original
portable
kernels
portable + torch.compile
TensorRT fp16
121
89.4
84.4
59.6
43.7
2272 / 2384
1614 / 1792
271 / 1914
1809 / 1890
1018 / 1110
ema-vfi-tsynthetic (1080x1920)original
portable
kernels
portable + torch.compile
TensorRT fp16
287
233
207
165
125
3940 / 4290
2827 / 3184
368 / 3566
3325 / 3702
1719 / 1766
ema-vfi-small-tsynthetic (1080x1920)original
portable
kernels
portable + torch.compile
TensorRT fp16
114
89.4
84.3
59.8
43.4
2272 / 2384
1614 / 1792
271 / 1914
1809 / 1890
1018 / 1110
Details
  • Original code: https://github.com/MCG-NJU/EMA-VFI at 75b6f6a889e6
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/MCG-NJU/EMA-VFI/blob/75b6f6a889e695df875e103374040d47a4cfac7c/LICENSE ; https://github.com/MCG-NJU/EMA-VFI/blob/75b6f6a889e695df875e103374040d47a4cfac7c/README.md (checkpoints: https://drive.google.com/drive/folders/16jUa3HkQ85Z5lb5gce1yoaWkP-rdCd0o)
  • Training data: Vimeo-90K (septuplets / triplets for frame interpolation) (README: the fixed-time models train on Vimeo-90K triplets (train.py); the arbitrary-time _t models are evaluated on 4x / 8x benchmarks, their training data is not stated (the paper: Vimeo-90K septuplets).)
  • Options: cuda_graphs = True (speed only), tta = False
  • Kernel libraries: cudnn_hacc
  • Variants: ema-vfi, ema-vfi-small, ema-vfi-t, ema-vfi-small-t
  • Outputs: frame
  • Input size: any H x W >= 32, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): ema-vfi 1988x2880 (7.4 GiB peak allocated, 9.1 reserved); ema-vfi-small 3000x4000 (8.9 GiB peak allocated, 11.4 reserved); ema-vfi-t 1988x2880 (7.4 GiB peak allocated, 9.1 reserved); ema-vfi-small-t 3000x4000 (8.9 GiB peak allocated, 11.4 reserved)
  • ema-vfi 1080x1920, first call: portable + torch.compile 91 s (cold Inductor cache), TensorRT fp16 91 s (ONNX + engine).
  • ema-vfi-small 1080x1920, first call: portable + torch.compile 79 s (cold Inductor cache), TensorRT fp16 68 s (ONNX + engine).
  • ema-vfi-t 1080x1920, first call: portable + torch.compile 85 s (cold Inductor cache), TensorRT fp16 92 s (ONNX + engine).
  • ema-vfi-small-t 1080x1920, first call: portable + torch.compile 78 s (cold Inductor cache), TensorRT fp16 69 s (ONNX + engine).
  • ema-vfi original 1080x1920: torch.autocast(float16) around the call; upstream MultiScaleFlow as Model.inference (no TTA), timestep 0.5, BGR, replicate pad to 32
  • ema-vfi-small original 1080x1920: torch.autocast(float16) around the call; upstream MultiScaleFlow as Model.inference (no TTA), timestep 0.5, BGR, replicate pad to 32
  • ema-vfi-t original 1080x1920: torch.autocast(float16) around the call; upstream MultiScaleFlow as Model.inference (no TTA), timestep 0.5, BGR, replicate pad to 32
  • ema-vfi-small-t original 1080x1920: torch.autocast(float16) around the call; upstream MultiScaleFlow as Model.inference (no TTA), timestep 0.5, BGR, replicate pad to 32
  • ema-vfi load / first call: original 2.69 s / 0.5 s, portable 0.83 s / 0.234 s, kernels 0.81 s / 0.207 s
  • ema-vfi-small load / first call: original 0.36 s / 0.179 s, portable 0.27 s / 0.09 s, kernels 0.56 s / 0.085 s
  • ema-vfi-t load / first call: original 2.77 s / 0.495 s, portable 0.73 s / 0.398 s (480x854), kernels 1.18 s / 0.359 s (480x854)
  • ema-vfi-small-t load / first call: original 1.05 s / 0.175 s, portable 0.28 s / 0.437 s (480x854), kernels 0.56 s / 0.348 s (480x854)
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

DAVIS 2017 trainval 480p (JPEG), frames 0 / 2 and 20 / 22 of each of the 90 videos give the frame 1 / 21 at time 0.5, compared with the real one: PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) of the output rounded to uint8, on RGB in [0, 1], averaged over the triplets for the 180-triplet benchmark. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portablekernelsnote
ema-vfiDAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM27.67 / 0.811927.67 / 0.811927.67 / 0.811927.67 / 0.8119
ema-vfi-smallDAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM27.44 / 0.804327.44 / 0.804327.44 / 0.804327.44 / 0.8043
ema-vfi-tDAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM29.07 / 0.856829.07 / 0.856729.07 / 0.856729.07 / 0.8567
ema-vfi-small-tDAVIS 2017 480p, 2 frame triplets per video (180), PSNR / SSIM28.65 / 0.846128.65 / 0.846128.65 / 0.846128.65 / 0.8461

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks d199e94c, 2026-11-14.

Parity

CPU, float32: max |diff| <= 5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.001 and p99 <= 0.005 (absolute error of the output frame).

variantkernels error vs original, mean / p99GPU, torchkernels used
ema-vfi0.00018 / 0.00062RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400
ema-vfi-small0.00018 / 0.00058RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400
ema-vfi-t0.0002 / 0.00082RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400
ema-vfi-small-t0.00019 / 0.00065RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400

Limitations

  • Kernels keep CUDA graphs: their private pool and static outputs stay reserved, so peak reserved is ~670 (480x854) / 3200 (1080x1920) MiB above portable (peak allocated is not); cuda_graphs=false or release_graphs() frees it.

Example output

No example rendered for this checkpoint yet.