Cool way to calculate optical flow for two images very easily.
Seems to be very good: Optical Flow Estimation Benchmark
Paper: RAFT: Recurrent All Pairs Field Transforms for Optical Flow
OG Repo: princeton-vl/RAFT
pip3 install -r requirements.txt
We will use RAFT to create optical flow numpy arrays from two images and save them in a directory. First you will need to download the models. Just run:
sh download_models.sh
After the download you can run the model on your images like this:
run.py --images_dir=<YOUR DIRECTORY> --output_dir=<OUTPUT DIRECTORY>
You can visualize the .npy optical flow files with vis.py
:
vis.py ---npy_dir==<YOUR DIRECTORY> --output_dir=<OUTPUT DIRECTORY>