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

Motion blur magic #833

Open
AdrianEddy opened this issue May 10, 2024 · 4 comments
Open

Motion blur magic #833

AdrianEddy opened this issue May 10, 2024 · 4 comments

Comments

@AdrianEddy
Copy link
Collaborator

We could implement a way to remove the motion blur using AI model: https://github.com/google-research/maxim

Then using the new AI-based optical flow, we can add the motion blur back after stabilization

For reference:

@webben216
Copy link

If I understand correctly, do you want to process all frames with the neural network or only certain frames with a certain amount of blur? The example on replicate takes around 17 seconds for a single frame on a Nvidia T4 GPU, im my opinion way to long to process all frames.

Looking at my footage with long exposure times (walking), only around 10% of the frames have significant motion blur.

Things I am asking myself:

  • How bad is the flickering on successive frames? Do we need some temporal filtering?
  • How does the model deal with 10, 12, or 14 bit raw/ log footage?

@AdrianEddy
Copy link
Collaborator Author

AdrianEddy commented May 25, 2024

Only some frames, the ones with most blur, based on the movement amount from gyro data. Each frame will likely need to be stored to a file. Hard to tell exactly how it will behave in real world, but I imagine we can add some blending or something if there's too much inconsistency.

I'm sure the network will be much faster in Rust than in Python. Python does a lot of slow things before and after actual neural network, we'll do all of them on a GPU in a single step instead.

@webben216
Copy link

That makes sense. I never used cog, but with TensorRT, the inference time didn't change significantly between the Python and C++.

Why do we need to add motion blur back in Gyroflow? In my view, motion blur is a totally separate feature. The only advantage I see adding motion blur in Gyroflow is a reduced crop, if it is possible to apply it to the full unstabilized frame with the information of the stabilization.

@AdrianEddy
Copy link
Collaborator Author

Because motion blur looks good if it's done right. That's why people use ND filters and slow shutter speeds, but this is incompatible with digital stabilization, so we can add it artificially after stabilization.

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

2 participants