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

improving glass blur using numba #18

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Conversation

prakass1
Copy link
Member

This pull request is to speed up the computation of glass_blur using numba (https://numba.pydata.org/numba-doc/latest/user/5minguide.html). Since, the glass_blur had only numpy and loop based computations, I was able to move it to a separate method with @njit decorator improving the speed significantly. I also have added the requirements.txt and the setup.py is also updated and have added a demo file to test the same.

Steps done to run is:

pip install -r requirements.txt
python test_demo.py

Results obtained:

defocus_blur 0.9493465423583984
glass_blur 5.243793964385986 (Improved from about 1 minute to 5 seconds)
motion_blur 2.2798967361450195
zoom_blur 19.582147359848022

@michaelisc michaelisc self-requested a review March 31, 2021 08:39
@michaelisc
Copy link
Member

Looks great! Thanks for adding the demo script as well!

@michaelisc michaelisc closed this Mar 31, 2021
@michaelisc michaelisc reopened this Mar 31, 2021
@michaelisc michaelisc merged commit d4ce97e into bethgelab:master Mar 31, 2021
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

Successfully merging this pull request may close these issues.

2 participants