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

how fast is it compared to opencv resize ? #36

Open
rom1504 opened this issue Jul 13, 2021 · 3 comments
Open

how fast is it compared to opencv resize ? #36

rom1504 opened this issue Jul 13, 2021 · 3 comments

Comments

@rom1504
Copy link

rom1504 commented Jul 13, 2021

Would be useful to add that to the benchmark

@rom1504
Copy link
Author

rom1504 commented Jul 13, 2021

also compared to pillow simd https://python-pillow.org/pillow-perf/

@sebasi
Copy link

sebasi commented Jul 29, 2021

Until this gets to the benchmark I did some simple benchmarks myself.
Perhaps this helps someone...

jpegtran was the fastest in all situations, but unfortunately also presents the worst image quality due to be limited to the NEAREST algorithm (similar to pillow-nearest).
A real boost was to use pillow-simd. For my usecase (downscaling images) performance is about 3x better than default pillow.

Method Resampling filter performance
jpegtran 110
pillow-simd NEAREST 96
pillow-simd BOX 77
pillow-simd BILINEAR 71
pillow-simd HAMMING 70
pillow-simd BICUBIC 64
cv2 53
pillow NEAREST 33
pillow BOX 26
pillow BILINEAR 24
pillow HAMMING 23
pillow BICUBIC 19
pillow LANCZOS 17

Versions used: Pillow-7.2.0, Pillow_SIMD-7.0.0.post3, jpegtran-cffi 0.5.2, opencv-python 4.4.0.46

Values indicate the avg amount of images processed per second (on a single core VM) - so just take the value for basic comparison.

@cbm755
Copy link
Collaborator

cbm755 commented Jul 29, 2021

Thanks @rom1504 and @sebasi

@sebasi What is the benchmark problem? (I assume downscaling, but is it same problem mentioned in the readme?)

The README file mentioned: "Benchmark source: https://gist.github.com/jbaiter/8596064". If either of you feel like modifying that script to include pillow-simd (to start with), I'd be happy to help get that merged.


Caveat: I'm a co-maintainer of this but haven't had a chance to do much with it!

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

3 participants