Is there a dlib library port for java?

hereForLearing picture hereForLearing · May 31, 2016 · Viewed 7k times · Source

I'm actually using OpenCV for face detection, but after watching this video : https://www.youtube.com/watch?v=LsK0hzcEyHI , I've noticed that dlib is much more accurate, and even in my tests, gives a lot of fale positives (but doesn't miss any face), does anyone know how to use dlib within a Java web application (not android) ? I've already found a port to Android, but I don't thinkk it's possible to use it with in a java web application. Thank you

Answer

S. Saad picture S. Saad · Jun 1, 2016

I have used dlib myself, and yes it is a very advanced and precise library. There is no port in Java as far as I know. But you can always have it compiled to a shared library (.so in linux or .dll in Windows), and then use that inside your Java code.

More on using a dll or using an so in java

There is also an option to use the C++ library directly within Java, using proxies. You might want to look into that.

Edit : As per @evgeniy's comment, most of dlib is header-only templates. You will not be able to use those if you export dlib directly as a shared library. What you might want to do instead is to expose whatever APIs you need, see here

Edit 2 : As @davis-king's pointed out, you may want to look into using swig and cmake as is done in the mitie/dlib Java api : See here.