scikit-image on GPU

762 views
Skip to first unread message

Pkore

unread,
May 4, 2015, 2:22:01 PM5/4/15
to kivy-...@googlegroups.com
I'm working on an app that processes large images using scikit-image. I'm following is the image stitching example at this link:https://peerj.com/articles/453/. I'm a GPU n00b so I'm hoping someone can guide me to a method for using scikit-image on the GPU under Android. Any help would be greatly appreciated. 

Alexander Taylor

unread,
May 4, 2015, 3:00:24 PM5/4/15
to kivy-...@googlegroups.com
Does scikit-image actually support using the gpu? I didn't see it on the linked page or in their docs.

Either way, I doubt you can easily make its gpu processing work on most android devices. I could comment more if you link some information about this functionality.

Pkore

unread,
May 4, 2015, 3:22:13 PM5/4/15
to kivy-...@googlegroups.com
Thanks for the reply. If scikit-image can't work with the GPU (which would stink) how could the image stitching technique that is presented in the link above be achieved on the GPU? I looked at pyopencl for GPU access but I'm not sure if this will work on android. I know that Kivy is using the GPU so it should be possible to use the GPU. 

Alexander Taylor

unread,
May 4, 2015, 3:26:50 PM5/4/15
to kivy-...@googlegroups.com
Why do you need to use the GPU? I don't think scikit-image does in the
first place, so if you were already using that then you probably don't
need to change anything.

You can use opencl on some devices, but not remotely all of them and I'm
not sure how much official support there is.

Kivy uses opengl. You can use this for some image tasks, but it's a
pipeline for displaying graphics and so making image operations work
with it can be painful, especially complex things like the algorithms in
your linked article.

On 04/05/15 20:22, Pkore wrote:
> Thanks for the reply. If scikit-image can't work with the GPU (which
> would stink) how could the image stitching technique that is presented
> in the link above be achieved on the GPU? I looked at pyopencl for GPU
> access but I'm not sure if this will work on android. I know that Kivy
> is using the GPU so it should be possible to use the GPU.
>
>
> On Monday, May 4, 2015 at 11:22:01 AM UTC-7, Pkore wrote:
>
> I'm working on an app that processes large images using
> scikit-image. I'm following is the image stitching example at this
> link:https://peerj.com/articles/453/
> <https://peerj.com/articles/453/>. I'm a GPU n00b so I'm hoping
> someone can guide me to a method for using scikit-image on the GPU
> under Android. Any help would be greatly appreciated.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Kivy users support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/kivy-users/uguEiQ78htQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> kivy-users+...@googlegroups.com
> <mailto:kivy-users+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


signature.asc

Pkore

unread,
May 4, 2015, 5:36:45 PM5/4/15
to kivy-...@googlegroups.com
Do you think something like the above would benefit from the GPU? I do. The images I need to process could be up to 16 mega pixels so doing any type of manipulation on them would benefit from the GPU. I'm not looking for a "why would you want to do this?" response, I need to know if scikit-image can be made to work with the GPU or if I should just use another library like pyopengl or pyopencl to get the job done. If pyopengl is the way to go where can I get some info on how to do this with that on the GPU. I've done my fair share of googling for articles on this and can't find any.

" making image operations work
with it can be painful, especially complex things like the algorithms in
your linked article."

 I'm a programmer- painful is what I do;)

Alexander Taylor

unread,
May 4, 2015, 5:41:17 PM5/4/15
to kivy-...@googlegroups.com
Yes, lots of image algorithms can benefit from the gpu, but I don't
think scikit-image uses it - it uses fast numpy operations instead, good
enough for a lot of purposes. I could be wrong, you'll have to ask the
scikit-image team to be sure, but I didn't see it mentioned anywhere.
signature.asc

Pkore

unread,
May 4, 2015, 5:50:58 PM5/4/15
to kivy-...@googlegroups.com
I'm pretty sure you're right about that. I would prefer to use scikit-image but without the GPU the requirements of the app go far beyond what the CPU can do. Where can I get info about using a different library for this (Maybe some algorithm tutorials too).



On Monday, May 4, 2015 at 11:22:01 AM UTC-7, Pkore wrote:

Alexander Taylor

unread,
May 4, 2015, 5:52:06 PM5/4/15
to kivy-...@googlegroups.com
I don't know, I haven't ever needed to do image processing with such
constraints.

On 04/05/15 22:50, Pkore wrote:
> I'm pretty sure you're right about that. I would prefer to use
> scikit-image but without the GPU the requirements of the app go far
> beyond what the CPU can do. Where can I get info about using a different
> library for this (Maybe some algorithm tutorials too).
>
>
>
> On Monday, May 4, 2015 at 11:22:01 AM UTC-7, Pkore wrote:
>
> I'm working on an app that processes large images using
> scikit-image. I'm following is the image stitching example at this
> link:https://peerj.com/articles/453/
> <https://peerj.com/articles/453/>. I'm a GPU n00b so I'm hoping
> someone can guide me to a method for using scikit-image on the GPU
> under Android. Any help would be greatly appreciated.
>
signature.asc

Kovak

unread,
May 4, 2015, 8:59:09 PM5/4/15
to kivy-...@googlegroups.com
It is highly unlikely you will be able to use gpu processing via openCL on many mobile devices.

Just because an application can use the gpu for drawing does not mean it can necessarily use the gpu for other calculations. This blog post lists some devices that do have support:

http://arrayfire.com/opencl-on-mobile-devices/

However, from what I know of people who do do gpu image processing for a living, they use CUDA on Nvidia desktop cards (The Titan card is a favorite). OpenCL is relatively primitive compared to CUDA.

Pkore

unread,
May 5, 2015, 10:09:41 AM5/5/15
to kivy-...@googlegroups.com
Thank you for that info! Is image processing on the GPU using opengl not feasible on android though? If not I guess my app could be on the desktop too (thanks to cross-platform kivy).

Kovak

unread,
May 5, 2015, 3:15:18 PM5/5/15
to kivy-...@googlegroups.com
It depends on what you mean by image processing. The openGL es2.0 api is very specific and relatively simplistic. If you can come up with a way to do what you want using only these functions and some custom shaders it is possible you could do it. But since it seems you are looking to replace scikit-image, it is highly unlikely you will get that level of flexibility.

Pkore

unread,
May 5, 2015, 5:57:45 PM5/5/15
to kivy-...@googlegroups.com
Thank for your replies, they were very helpful (Saved me from a lot of hair pulling)! I think I have another way of getting speed increases- resizing, converting to two color image, processing with cythonized modules on multicores.
Reply all
Reply to author
Forward
0 new messages