Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is very difficult execute flandmarks .dll + flandmark-demo #1

Closed
henriquem opened this issue Sep 4, 2014 · 9 comments
Closed

Is very difficult execute flandmarks .dll + flandmark-demo #1

henriquem opened this issue Sep 4, 2014 · 9 comments
Labels

Comments

@henriquem
Copy link

I would like to propose an tips about the flandmark-demo.

I'm cannot to compile in C++ the flandmarks ( very difficult) to generates .dll to afterwards running bytedeco JNA/JNI from flandmarks

I think very difficulty to compile this framework, or at least you provide an .dll to use the demonstration (integrated JAVA with flandmarks .dll)

Thanks

@saudet
Copy link
Member

saudet commented Sep 4, 2014

There is a simpler example here:
https://github.com/bytedeco/javacpp-presets/tree/master/flandmark
Let us know if you run into any problems with that one, thanks!

@saudet saudet closed this as completed Sep 4, 2014
@henriquem
Copy link
Author

I see !

But Don't you agree that I need an file .dll to solve this exception ?

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)

This Exception ocurred when I tried to load the file model.dat in this simple line:
org.bytedeco.javacpp.flandmark.FLANDMARK_Model model =
org.bytedeco.javacpp.flandmark.flandmark_init.flandmark_init("C:/flandmark/data/model.dat");

I'm using the same library like your pom.xml:
...
org.bytedeco.javacpp-presets
flandmark
1.07-0.9


org.bytedeco.javacpp-presets
opencv
2.4.9-0.9


org.bytedeco
javacpp
0.9


org.bytedeco
javacv
0.9


org.bytedeco
opencv-windows-x86.jar
2.4.9
...

I don't know what I can to do :'(

@henriquem
Copy link
Author

Follow the complete Exception

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)

Caused by: java.lang.UnsatisfiedLinkError: no flandmark_static in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:401)
... 4 more

@saudet
Copy link
Member

saudet commented Sep 4, 2014

I follow the instructions, and it works just fine. To help you, I would need to reproduce the problem here on my machine. Please provide more details about what you are doing exactly.

@henriquem
Copy link
Author

Ok. Thanks so much for your attention!

Firstly I did the download from http://cmp.felk.cvut.cz/~uricamic/flandmark/
I got the flandmark_v107.zip (latest zip from GitHub)

  • Descompressed at C:/flandmark
  • I already use opencv 2.4.9 and 2.4.8 ( I usually I use the 2.4.9)

I Noticed that when I extracted the flandmark, The structure of folders is:

  • data
  • examples
  • learning
  • libflandmark
  • matlab_toolbox
  • CMakeLists.txt
  • AUTHORS
  • INSTALL
  • LICENSE
  • README

Project JAVA
My libraries accorded as pom.xml :

M2_REPO/org/bytedeco/javacpp-presets/flandmark/1.07-0.9/flandmark-1.07-0.9.jar * not has .dll into this .jar, just has JNI class
M2_REPO/org/bytedeco/javacpp-presets/opencv/2.4.9-0.9/opencv-2.4.9-0.9.jar
M2_REPO/org/bytedeco/javacpp/0.9/javacpp-0.9.jar

The Simple Class
I simple class is bellow is enough to see the exception
public class SimpleExample {
public static void main(String[] args) {
org.bytedeco.javacpp.flandmark.FLANDMARK_Model model =
org.bytedeco.javacpp.flandmark.flandmark_init("C:/flandmark/data/model.dat");
}
}

When executed the method main :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniflandmark in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.flandmark.(flandmark.java:13)
at SimpleExample.main(SimpleExample.java:5)
Caused by: java.lang.UnsatisfiedLinkError: no flandmark_static in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:401)
... 3 more

I suppose that We needs the .dll files from flandmarks,
because when I downloaded flandmark, and came only source code in *.cpp

I struggled in generating files .dll from flandmarks_v107, But unsuccessful.

@saudet
Copy link
Member

saudet commented Sep 4, 2014

How do you execute the main() method?

@henriquem
Copy link
Author

I use simple command:
java SimpleExample.class
But I'm running by eclipse.
I know that I need to put the variable -Djava.library.path= ???

But My doubt is What the directory specific I need to put in this variable ?

I generated by Cmake-gui the c:/flandmark, And generated bellow is where build to binaries indicated by Cmake-gui, the results of generating is it:
C:\flandmark-bin

  • CMakeCache.txt
  • CMakeFiles
  • examples
  • libflandmark
  • matlab_toolbox
    C:\flandmark-bin\CMakeFiles
    • cmake.check_cache
    • CMakeGNUtoMS_lib.bat
    • CMakeOutput.log
    • CMakeTmp
      C:\flandmark-bin\CMakeFiles\3.0.1
    • CMakeCCompiler.cmake
    • CMakeCXXCompiler.cmake
    • CMakeDetermineCompilerABI_C.bin
    • CMakeDetermineCompilerABI_CXX.bin
    • CMakeRCCompiler.cmake
    • CMakeSystem.cmake
    • CompilerIdC
    • CompilerIdCXX
      C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdC
  • a.exe
  • CMakeCCompilerId.c
    C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdCXX
  • a.exe
  • CMakeCXXCompilerId.cpp
    C:\flandmark-bin\CMakeFiles\CMakeTmp
    C:\flandmark-bin\examples
  • CMakeFiles
  • face.jpg
  • flandmark_model.dat
  • groupphoto.jpg
  • haarcascade_frontalface_alt.xml
  • seq_bruges04_300frames.avi
    C:\flandmark-bin\examples\CMakeFiles
    C:\flandmark-bin\libflandmark
    • CMakeFiles
    • flandmarkConfig.cmake
      C:\flandmark-bin\libflandmark\CMakeFiles
      C:\flandmark-bin\matlab_toolbox
  • mex
    C:\flandmark-bin\matlab_toolbox\mex
    • CMakeFiles

Now, I dont know if I need to generate another compilation .dll files starting folders above, to After I can put something like variable java.library.path=C:/flandmark-bin/dlls ???

Could you clear my doubt, in detail ?
Thanks for your attention and patience!
I'm almost there !!!

Thks

@saudet
Copy link
Member

saudet commented Sep 4, 2014

Ok so instead of using Eclipse, use Maven as shown in the simple example here and it will work:
https://github.com/bytedeco/javacpp-presets/tree/master/flandmark

@henriquem
Copy link
Author

Thanks so much for your help !

I caught the jar flandmark-1.07-0.9-windows-x86.jar to solved the problem about JNI

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants