roymacdonald / ofxDLib-DEPRECATED-

openFrameworks addon for including and wrapping the dlib library
Other
18 stars 12 forks source link

version of dlib used in this addon #11

Open sebasobotka opened 7 years ago

sebasobotka commented 7 years ago

Hi, I think there should be somewhere information about dlib version used in the addon. I found that there is some info about it in CMakeList.txt but I cannot find this file anymore.

set(CPACK_PACKAGE_VERSION_MAJOR "18")
set(CPACK_PACKAGE_VERSION_MINOR "18")
set(CPACK_PACKAGE_VERSION_PATCH "0")

Now , there is a 19.4 release of dlib and many features added which can be helpful in some cases.
For example, I was playing a little with example-FaceTracker and It works but it's very choppy. Some optimization is needed here. One of this is update to neewest version of dlib.

roymacdonald commented 7 years ago

The apothecary script I wrote is set for version 19.4 and the includes are also verifying so. https://github.com/roymacdonald/ofxDLib/blob/master/libs/dlib/include/dlib/revision.h

I compiled it for OSX, and android if I am right. The windows lib I took it from other place, so it might be outdated. Which os do yo use?

cheers

sebasobotka commented 7 years ago

I am on Windows. And I forked your Repo while ago and didn't sync it. So that's the reason why I've got dlib version 18.18 locally.

But I've got some questions:

  1. How does the facetracker example work on osx?
  2. Could you explain me a little what the apothecary sript is? Does it compile the dlib code to static lib? I cannot see the lib for windows in your repo. And this part confuses me a little because there wasn't a static lib for windows and the addon works. How? Is it possible because of adding libs/dlib/all/source.cpp to a project?

I compiled today dlib using CMake and VisualStudio to a static lib but not sure if it's done well. I will check it later. Should I compile it by apothecary script ? Is it even possible? cheers

roymacdonald commented 7 years ago

Hi @sebasobotka, The face tracker should work on any OS, it is not OS dependent. It is just a simple wrapper of dlib's face tracker and landmark detection. It is based on this example

Apothecary is a system that is used by OF to compile automatically all the needed libraries. You can download it from here. Place it in openFrameworksFolder/scripts/ It is mainly a bash script that will download the needed libraries, compile these with cmake and move the compiled libs and includes to the corresponding directory within the OF directory structure. BTW, I'm not sure how you handle it on Windows. It has some good documentation so it shouldnt be a problem if you want to use it. What you did to compile dlib is probably the same that this script will do. If you are worried about the settings for compilation, take a look at the apothecary script for the configuration used. remember to move the includes and the compiled lib into the addon folder.

You're right, there's no win lib in my repo. I think I removed it be cause it was the old one. Dlib is a header-only library so when it gets included in the project, all the necessary code will be there. The sources.cpp just will include those files according to the preprocessor settings. I think that it works regardless of having sources.cpp in the project. What CMake will do when compiling the app is to set the preprocessors according to your needs and compile.

Hope this helps. cheers

sebasobotka commented 7 years ago

Hi @roymacdonald, Thank you so much for your reply. It's a huge bunch of information. I will take a look at these things ;) Regarding to question nr1 I meant how "smooth" does it work on osx? I've got only 1-3 fps on Windows.

roymacdonald commented 7 years ago

ha, sure. It works really well on osx, at 60fps. but you must run it on the release version. Probably you are running on debug and that is what's slowing it so much. Just drop a line if you need more help. cheers

sebasobotka commented 7 years ago

Hi @roymacdonald I updated dlib library on Windows and there are some improvements. Now it works at 7-9fps, previously 1-3fps. I am not sure still if it's ok. I'm running on release mode. My setup is Windows10, 64bit, i5-3210M 2.5GHz, 8GB Ram. Is it a memory issue?

win_rel_19 4

I did run code on MacOS (MacBookPro 15'', macOS Sierra 10.12.3, 8GB RAM) also. It works better here, at @13-20fps.

screen shot 2017-04-23 at 19 23 04

Please, could you put this line into ofApp::draw() and check it out? ofSetWindowTitle(ofToString(ofGetFrameRate()));

Because it's my first experience with oF and osx I need some explanation. I did run the apothecary script from openFrameworksFolder/scripts/apothecary folder terminal: ./apothecary update ofxDlib

The script downloaded everything and built the dlib to the folder openFrameworksFolder/scripts/apothecary/build. I had to move these files to addon folder manually. Is it correct?

And last thing. The script was finished with this line:

/Users/sebastian/Projects/Openframeworks/of_v0.9.8_osx_release/scripts/apothecary/../../addons/ofxDlib/scripts/formulas/dlib.sh: line 68: ADDONS_DIR: unbound variable\

Is it important? because finally the code works..

cheers

roymacdonald commented 7 years ago

well actually I just tested it and it runs at 15fps on a macbookpro i7 2.5ghz 16gbram. I thought that it was better because I had tested recently ofxFaceTracker2 which is supposed to be a similar implementation, but it actually runs a lot better, as it implements some threading. You should try that other addon.

about apothecary, you'll need to update to the github master. That issue was fixed there. No, the files are moved by the apothecary script. No need to move manually. Yet, because of the error that apothecary threw, although dlib got compiled, the files didn't move to their correct place, so if you did it manually it is fine. best

sebasobotka commented 7 years ago

FYI I tested that other addon before. I've updated to the newest lib and it runs at 20fps max. A little annoying is that my face is stable but drawn face shakes.

ofxtracker_newdlib