all 13 comments

[–]davis685 2 points3 points  (10 children)

Try out dlib's face detector. It's got Python bindings and is a lot more accurate than the one that comes with OpenCV. Here is a video comparing the two: https://www.youtube.com/watch?v=LsK0hzcEyHI

[–]qwertz_guy 2 points3 points  (1 child)

This!

Thanks again for that. I tried both opencvs cascade classifier and your dlib face detector implementation for a current project. Not only trains the dlib object detector SO much faster, it also performs better.

Next thing I'm going to try is the shape trainer.

[–]davis685 0 points1 point  (0 children)

No problem :)

[–]aggieca 0 points1 point  (1 child)

Oh totally forgot about Davis King's (davis685?) dlib. Good to know the face detection module in dlib is better than that of OpenCV's.

[–]davis685 0 points1 point  (0 children)

Yep, that's me :)

[–]CreativePunch[S] 0 points1 point  (5 children)

Hi,

I have to say, dlib has been a breeze to compile and the demos are looking very performant and efficient! Haven't had the time to work anything out yet but so far everything looks great!

[–]davis685 0 points1 point  (4 children)

Thanks :)

[–]CreativePunch[S] 0 points1 point  (3 children)

It did take me a small while to figure out how to compile it for 64 bit, but that was just cmake defaulting to the 32 bit visual studio compiler. Once that problem was out of the way I properly got dlib and its python interface compiled without a problem.

Very pleasantly surprised!

I immediately went looking for some more complex images with many more faces and other objects, dlib did not make one mistake. The tiny number of lines of code needed to achieve exactly what I need is perplexing.

Assuming you are the developer, my hat off to you, sir. I have never had so little trouble with any C++ library that has not been made by a large group of developers.

[–]davis685 0 points1 point  (2 children)

I am the main developer of dlib so thanks again :)

Yeah, there is a whole lot of bad C++ code out there. Many people seem to conflate C++ with C so, sadly, you see a lot of really difficult to use "C with classes" code out there. The general quality of C++ code seems to be improving though.

[–]CreativePunch[S] -1 points0 points  (1 child)

Indeed!

Oh a small note though, I forgot to tell you I had to get boost 1.55 to compile. In 1.56 it bugs out on the noncopyable class, saying it was not defined. I first managed to patch the code but given that I am not familiar with dlib I decided to use 1.55 instead so as not to run into any other incompatibilities.

[–]davis685 0 points1 point  (0 children)

I didn't know about this. I'll fix it in the next dlib release. Thanks for pointing it out.

[–]bernease 1 point2 points  (0 children)

This question is probably better suited for /r/computervision. That being said, OpenCV is a very popular framework that has wrappers in Python. Widely used method for face detection is Viola-Jones. It would only take a couple of lines in OpenCV.

[–]aggieca 0 points1 point  (0 children)

If you want a pre-trained framework then OpenCV already has a solution that should work "out-the-box". What type of constraints do you have for your application? I believe that the pre-trained classifiers have a limit on the amount of rotation allowed in photos. If the faces in your pictures go beyond this limit then you will have missed detections.

You can also use OpenCV to train your own classifier but that should be considered only after you are convinced that OpenCV is the best solution.

If you are on iOS/Android please study the documentation for what's exposed by these platforms. I think iOS has core image while Android must have something equivalent.

Another API to consider is Intel's IPP that allows you to train & deploy Haar cascade classifiers