ofxOpenFace icon indicating copy to clipboard operation
ofxOpenFace copied to clipboard

action units / other notes

Open ofZach opened this issue 7 years ago • 4 comments

greetings, I was able to get action units to work by recompiling openface with a different version of boost

I think it was something like this (reviewing my history)

brew install [email protected] --cc=clang
brew link --force [email protected]

or something like this. I don't have debug and release builds of the openface libraries (not sure if there's a special cmake command to get that) but happy to share if helpful.

I think I also had to set a #define in opencv (latest) for openface to compile (something in traits.hpp)

couple of other notes -- setupsingleface() was missing some code for loading Haar I think, I copied some lines from setupmultiface to help.

ofZach avatar Jul 09 '18 15:07 ofZach

Hi Zach! Thanks for the heads up. I will work on this when I get the chance.

I did run different cmake commands for Debug/Release. It looked something like:

mkdir build_debug
cd build_debug
cmake -D CMAKE_PREFIX_PATH=/usr/local/Cellar/openblas/0.2.20_2 -D CMAKE_BUILD_TYPE=DEBUG ..

funkmeisterb avatar Jul 09 '18 21:07 funkmeisterb

cool thanks!

it's working but def crashing out at some point -- I will poke around a bit, I feel there's some weirdness with the versions of dlib and opencv and/or something with threading... I didn't have much time to dig into it yet.

here I am raising my eyes and AU1 AU2 get larger :)

dhrkm5uwkaaosis jpg-large

ofZach avatar Jul 09 '18 21:07 ofZach

ps requires more testing, but I found my crashing disappeared when I did this -- which makes a copy of the matToProcessColor

mutexImage.lock();
    cv::Mat rgb_image;
    matToProcessColor.copyTo(rgb_image);
    //cv::Mat rgb_image = matToProcessColor;
    cv::Mat grayscale_image;
    ofxCv::copyGray(rgb_image, grayscale_image);
    mutexImage.unlock();

see for example http://answers.opencv.org/question/32415/thread-safe/

ofZach avatar Jul 09 '18 22:07 ofZach

Hey @ofZach, check out the new branch OpenFace_v2.0.3. It includes an HAAR single face fix, and contains the Debug & Release libs for OpenFace compiled with Boost 1.57, which fixes the action unit issue. I've also added the thread-safe material copy. I did get some weird crashes too and never figured out where that came from. Good catch!

I don't have the time now to do a proper integration of action units into the example (GUI toggle, drawing), but if you look at FaceLandmarkVidMulti.cpp from the OpenFace examples, you can probably figure it out, as my code uses a lot of that logic. I've also noticed that the single face example doesn't do action units, and it would probably be good to do it in the OF integration.

funkmeisterb avatar Jul 10 '18 03:07 funkmeisterb