How to turn the image processing wheel faster using Cython and Numba.
|Project:||Numba, Cython, Growcut|
Tools such as numpy and scipy are the numerical workhorses of the modern python numerical "hacker". Particularly, numpy vectorization is a saviour when it comes to speeding up certain types of code without resorting to "plugging in" optimized code from other languages (c, c++).
Unfortunately vectorization doesn't always lead to huge performance gains and for this reason the python community is looking to other tools to (easily) speed up slow numerical code. This talk focuses on alternatives to vectorization with a practical comparison of Cython and Numba based code, which are gaining in popularity and use.
The problem that we will be focusing upon is digital image segmentation, where we will attempt to segment foreground and background objects from scenes from digital photos.
The talk will follow this format:
1) Describe a basic image segmentation algorithm.
2) Demonstrate a pure python implementation.
3) Compare a numpy "vectorized" version.
4) Discuss optimized Cython and Numba versions.
5) Evaluate the pros/cons of all approaches.
Hopefully the audience will walk away with a basic understanding of what Cython and Numba can provide as optimization tools and learn a little about image segmentation.
Nathan has spent many years tinkering with numerical algorithms and has a background in computer vision. He currently works at the Australian Bureau of Meteorology as a forecast system developer, creating tools that update (and derive) information from numerical weather models.