Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why so slow? #8

Open
ryanjay0 opened this issue Jan 3, 2018 · 7 comments
Open

why so slow? #8

ryanjay0 opened this issue Jan 3, 2018 · 7 comments

Comments

@ryanjay0
Copy link

ryanjay0 commented Jan 3, 2018

It takes me 4 seconds per 331x331 image. That's significantly slower than the 0.06 seconds Zisserman reports in the original two stream paper. Can i make this code work on the GPU somehow? Or do you know of a GPU implementation?

@pathak22
Copy link
Owner

This is a CPU implementation and does not use GPU. One way is to resize the image to smaller size and later upsample the flow image.

@jremmons
Copy link

I agree with @ryanjay0, this code is pretty slow... at least compared to other methods. It takes ~0.8 seconds on 256x256 frames compared to ~0.02 seconds for the Farneback opencv implementation (which is similar to the Brox algorithm used in two-stream paper I believe) on the CPU not GPU (I have an Intel E5-2687Wv4 CPU). I would love to use it in my research because the flow fields seem better than the Farneback algorithm, but at 40x slower than the Farneback opencv CPU implementation, it is unusable...

@pathak22
Copy link
Owner

pathak22 commented Feb 22, 2018

@jremmons I would recommend using it at 100x100 and then resize flow field back to 256x256. I wrote pyflow only because Farneback and other default algorithms in OpenCV were too inaccurate to be usable on anything but simplest of cases.
However, if Farneback is good enough for your use-case, then perhaps you can go ahead with it for the speed difference?

@pathak22
Copy link
Owner

@ryanjay0 @jremmons There is also an OpenMP multi-processing pull request here #3 . Depending on how many cores you have that can significantly improve the running time.

@jremmons
Copy link

@pathak22 I'll give resizing from 100x100 images a shot. Unfortunately, the multicore version won't help because I will already be computing the flow fields in a data parallel way.

@hyperfraise
Copy link

This repo is laughable. "super fast" what a joke

@dhruvsasuke
Copy link

A really great and a useful repository for optical flow calculation. Is it possible though that we might be getting a GPU based implementation of the same sometime in the future, because I am really looking forward to that... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants