bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.65k stars 738 forks source link

Add dlib library to javacpp-presets #49

Open aaronkhoo opened 9 years ago

aaronkhoo commented 9 years ago

Add dlib (https://github.com/davisking/dlib) to the javacpp-presets family.

crockpotveggies commented 7 years ago

I've started work on this and any help is appreciated. https://github.com/crockpotveggies/javacpp-presets/tree/master/dlib

There are a lot of header files so I'm unsure of how to handle them all. Some walkthrough on how to get started would be very helpful!

crockpotveggies commented 7 years ago

Alright some progress, there's a couple problems including javacpp unable to read a couple header files as well as some generated Java types break syntax.

I'm trying to parse a lot of these files but commonly get this error:

[INFO] Parsing /usr/local/Cellar/dlib/19.1_2/include/dlib/algs.h
[ERROR] Failed to execute JavaCPP Builder: null:0: Unexpected token '￿'

When I exclude those files I then get output like this:

[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[629,58] illegal start of expression
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[629,59] ';' expected
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[631,74] ';' expected
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[632,1] illegal start of expression
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[632,8] illegal start of expression
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[632,14] ';' expected
[ERROR] /Users/justin/Projects/javacpp-presets/dlib/src/main/java/org/bytedeco/javacpp/dlib.java:[4457,2] reached end of file while parsing

The generated java file looks like: @Name("is_config_reader<dlib::config_reader>") public static class is_config_reader<dlib::config_reader>

Thanks for your help!

saudet commented 7 years ago

@crockpotveggies Having the same conversation on both Gitter and here isn't going to be efficient, so let's stick to one of them. Like I said, we'll first need to get dlib's build in order.

crockpotveggies commented 7 years ago

Sorry about that was trying to pick up anyone else who wasn't on the Gitter channel. Let's stick to Gitter

crockpotveggies commented 7 years ago

@aaronkhoo started making progress on this, PRs welcome, this code here is compiling on OSX with Linux to follow: https://github.com/crockpotveggies/dlib-java

dlib is too complicated for creating entire presets unfortunately, but I'll be putting core functionality there and long-term we can use it to create presets (unless someone else does it first)

ndtreviv commented 6 years ago

I'm guessing this is a dead end now that repo no longer exists?

saudet commented 6 years ago

@crockpotveggies Still have it somewhere?

crockpotveggies commented 6 years ago

Deleted, I did not see a use for it now that we're getting better results with YOLOv3 and the repo itself was incomplete.

ndtreviv commented 6 years ago

Cool. Thanks. I came here because I was really looking for JNI bindings for using dlib. But I don't think I need it anymore.

crockpotveggies commented 6 years ago

@ndtreviv no prob thanks for letting me know

tahaemara commented 3 years ago

I added a java wrapper to simply use dlib face detector, facial landmarks, and face embedding models. https://github.com/tahaemara/jdlib

saudet commented 3 years ago

@tahaemara What's the reason you're not using JavaCPP?

tahaemara commented 3 years ago

@saudet Actually Jdlib is the first project I deal with JNI. And I want through implementing it to understand how things are done using plain JNI not using any other 3rd party libs likes Javacpp lib which of course makes a lot of things easy.