Java Wrapper For dlib for Linux and MacOSX. Till now the wrapper contains stubs for face HOG detector, facial landmarks, face embedding models.
JAR files contains binaries of Jdlib on current supprted platforms (Linux and Mac OS X) inside releases.
Also you can have everything downloaded and installed automatically with Maven after including the next dependency inside the pom.xml.
<dependency>
<groupId>com.emaraic</groupId>
<artifactId>jdlib</artifactId>
<version>1.0.1</version>
</dependency>
- Dlib installation requirments Using dlib from C++
- JDK 8 or latter
- Maven
$ 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. Then you can use it inside your project as an external jar or install it manually in local maven.
- Download needed models to example folder
$ 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
- Unzip model
$ bzip2 -dk shape_predictor_68_face_landmarks.dat.bz2
$ bzip2 -dk dlib_face_recognition_resnet_model_v1.dat.bz2
- Change Diectory to an example folder such as faces_clustering:
cd examples/faces_clustering/
- Build package via maven
mvn package
- Run example
java -jar target/JdlibExamples-1.0.0-jar-with-dependencies.jar