Giter VIP home page Giter VIP logo

visualisingraftopticalflow's Introduction

Visualising RAFT OpticalFlow

Visualizing with a GIF optical flow.

The optical flow is computed with RAFT architecture (also works with no GPU, just slower)

Settings

To start, be sure to create a folder results in your current working directory. Then, create a folder with the name of your video, in which to save the results of the computed optical flow. In this folder there must be the video named as final.mp4.

It should look like this

current_directory
├── results/
│   └─── video_name/
│         ├─── rename.sh
│         └─── final.mp4
├── runner_optiflow.sh
└── optiflow.py

After that, be sure to know how many frames your video is long, then change that value in the file runner_optiflow.sh. Also, change the --input tag in the file runner_optiflow.sh with the name of the video you will work on.

Compute optical flow

Now we are ready. Just launch

./runner_optiflow.sh

Creating optical flow GIF

After having computed the optical flow for each couple of successive frames, be sure to change in rename.sh the correct number of frames to be renamed, launch

./rename.sh

Now execute

ffmpeg -f image2 -framerate 30 -i flow%d.png -loop -1 flow.gif

to finally generate the GIF visualazing the optical flow.

This is an example GIF

flow

Acknowledgments

This code is based on the original paper of RAFT: https://arxiv.org/abs/2003.12039

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.