Dlib is C++ library for machine learning and deep learning. Being it a header only library and we can’t compile it to shared library directly, it is impossible to expose it to java directly. Many dlib ports to many languages are exist but for Java SE I don’t see any of them works well. I started Jdlib by exposing the most dlib famous examples face HOG detector, facial landmarks, face embedding models.
Even there is a precompiled package on center maven central repository for MacOSX and linux binaries, I recommend to compile it manually as follow.
$ git clone https://github.com/tahaemara/jdlib.git
$ cd jdlib/jni
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ../../Jdlib
$ mvn package
After that you will have the JAR file including the binaries for your platform inside Jdlib/target. You can use it inside your project after adding it manually using you IDE. For example Netbeans, In the projects window, right-click the Libraries node for the your project and then click on "Add JAR/Folder...". Then locate the jdlib jar and select it.
Or simply create a maven project and install Jdlib jar manually in your local maven center.
$ cd examples
$ wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
$ wget http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2
$ bzip2 -dk shape_predictor_68_face_landmarks.dat.bz2
$ bzip2 -dk dlib_face_recognition_resnet_model_v1.dat.bz2
cd examples/faces_clustering/
mvn package
java -jar target/JdlibExamples-1.0.0-jar-with-dependencies.jar