This demos shows how using OpenCL on Mali as a backend for OpenCV can drastically improve performance of a face detection application.
Could you tell me the development platform?
using android? or ubuntu(linux)?
This demo is running on a Arndale board running Ubuntu.
Are we supposed to hear the audio on the video?
Which Arndale board? Exynos 5 Dual by Samsung Electronics 5250?
Samsung Electronics for Arndale board
No there is no audio. I am in the process of writing a blog to explain the video.
And yes, it is that Arndale.
Thanks for the info. A great teaser of what is to come. Looking forward to the blog.
Could you tell me which face detection algorithm you used? Is it HAAR or LBP based detection?
Another question, did you optimize code specifically for Mali? or you have used the face detection codes that comes with OpenCV?
The reason I am asking is because to my knowledge Mali does not support local memory and OpenCV's kernel codes includes local memory which gives error message while I tried to run those Mali GPU.
The algorithm uses Haar (It uses the XML cascade classifier which comes with OpenCV)
The OpenCL code in the OpenCV repository is optimised for desktop GPUs which have a very different architecture, therefore we rewrote the application from scratch based on the C version.
Mali does support local memory, however it's not faster than global memory, therefore most of the time it's a waste of memory bandwidth to transfer data from global to local memory before using it.
I believe the errors you get are instead related to some proprietary extensions, but even if you disable these extensions it will very likely run slowly because of the high number of barriers and local memory transfers which are simply unnecessary on Mali and will overload the memory system.
I have another question.
What is the scaling factor you used for the face detection? The scaling factor to create pyramid images.
We use 1.3 but this is configurable.
We based our demo on the C implementation present in OpenCV: https://github.com/Itseez/opencv/blob/master/samples/cpp/facedetect.cpp
I am wondering if you make optimized OpenCL code available to developers? I could not find any information so appreciate if you shed some light on this..
Unfortunately this was created as a demo and therefore the code is not suitable to be publicly released.
Thanks Anthony for your response. I feel however that it will be very valuable for developers to enhance it and then it can be made available to broader OpenCV developer community. As more and more ARM/ Mali GPU devices are coming into market, it will be very useful for developers as a reference. Thoughts?
I certainly agree with you that more examples of OpenCL code optimised for Mali would be very useful and this is something we are constantly reviewing. In the meantime I can point you towards a number of resources which do show many of the optimisation techniques that were used in the face detection demo.
First of all there is our OpenCL SDK available here...
A developer guide is also available here...
You can see a video tutorial, which includes towards the end an optimisation case study for the LaPlace filter:
There are also two other deep-dive video tutorial looking at specific optimisation techniques, available here:
There are also a number of blogs on this site which detail some optimisation approaches.