Home ONNX RAFT Optical Flow Estimation
Post
Cancel

Open In Github

Python scripts for performing optical flow estimation using the RAFT model in ONNX

RAFT Optical flow estimation ONNX eagle

Original video:https://youtu.be/3wdsE1UgP6k

Requirements

  • Check the requirements.txt file. Additionally, pafy and youtube-dl are required for youtube video inference.

Installation

1
2
pip install -r requirements.txt
pip install pafy youtube_dl>=2021.12.17

ONNX model

The original models were converted to different formats (including .onnx) by PINTO0309, download the models from his repository and save them into the models folder.

Original Pytorch model

The Pytorch pretrained model was taken from the original repository.

Examples

  • Image inference:
1
 python image_flow_estimation.py
  • Video inference:
1
 python video_flow_estimation.py
  • Webcam inference:
1
 python webcam_flow_estimation.py

Inference video Examples: https://youtu.be/GNwyuhYu7ZI

Cheetah

RAFT Optical flow estimation ONNX cheetah

Original video: https://youtu.be/-KheqfpUpr0

Water drop

RAFT Optical flow estimation ONNX water drop

Original video: https://youtu.be/gS_tU6chC4A

Plant

RAFT Optical flow estimation ONNX plant

Original video: https://youtu.be/cNr_cttSf4U

RAFT Optical flow estimation ONNX blink

Original video: https://youtu.be/lkJ4p__ZByU

Fall

RAFT Optical flow estimation ONNX fall

Original video: https://youtu.be/RKTXn_c2tyQ

Baseball player

RAFT Optical flow estimation ONNX baseball player

Original video: https://youtu.be/t_vEJu3jmpw

Dance

RAFT Optical flow estimation ONNX dance

Original video: https://youtu.be/1WIA6Yvj8Yg

References:

This post is licensed under CC BY 4.0 by the author.