Giter VIP home page Giter VIP logo

uricamic / clandmark Goto Github PK

View Code? Open in Web Editor NEW
199.0 33.0 111.0 14.62 MB

Open Source Landmarking Library

Home Page: http://cmp.felk.cvut.cz/~uricamic/clandmark

License: GNU General Public License v3.0

CMake 4.15% C++ 23.70% MATLAB 19.00% Makefile 0.02% TeX 0.52% C 5.32% Python 3.37% Jupyter Notebook 43.45% Batchfile 0.46%
facial landmarks detection structured output svm svm-classifier svm-learning svm-training

clandmark's Introduction

clandmark

Join the chat at https://gitter.im/uricamic/clandmark

Open Source Landmarking Library

Detailed description will be added soon

Dependencies

libclandmark

  • CImg (>= 1.5.6)
  • RapidXML (1.13)

If any of these libraries are installed in a known system prefix, CLandmark will try to use the already installed version. Otherwise, the internal version will be used and its files will be installed alongside CLandmark.

CAVEAT: The version of RapidXML that comes with CLandmark has been changed to fix some missing forward declarations.

References

In case you use clandmark in an academic work, please cite the following paper:

@article{Uricar-IMAVIS-2016,
  author = {U{\v{r}}i{\v{c}}{\'{a}}{\v{r}}, Michal  and 
            Franc, Vojt{\v{e}}ch and Thomas, Diego and Sugimoto, Akihiro  and Hlav{\'{a}}{\v{c}}, V{\'{a}}clav },
  title = {Multi-view facial landmark detector learned by the Structured Output {SVM}},
  journal = {Image and Vision Computing},
  volume = {47},
  pages = {45--59},
  year = {2016},
  month = {March},
  note = {300-W, the First Automatic Facial Landmark Detection in-the-Wild Challenge},
  issn = {0262-8856},
  doi = {http://dx.doi.org/10.1016/j.imavis.2016.02.004},
  url = {http://www.sciencedirect.com/science/article/pii/S0262885616300105},
  publisher = {Elsevier},
  address = {Amsterdam, Netherlands},
  keywords = {Deformable Part Models, Structured output SVM, Facial landmarks detection },
}

Visit http://cmp.felk.cvut.cz/~uricamic/clandmark for further information.

clandmark's People

Contributors

gitter-badger avatar jiapei100 avatar jzarl avatar k0stia avatar uricamic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clandmark's Issues

cmake 2.8

Hi,
My cmake version is 2.8, I tried to update it and ccmake to 3.0,but there is still a little problem.
The question is :
Can i just cmake the CMakeLists.txt in the root dir(version is 2.8),then make,without set required variables. If i do this,will it work correctly? Or can you generate the makefile for linux -_-
Thank you a lot.

Inconsistency detected error while ccmake

Hi,

trying to ccmake the package, I got the following error.

Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!

Regards,
Hayyan

Building with matlab extension

The mex gives me the following error:
g++: error: /home/alex/work/c/clandmark/build/libclandmark/libflandmark.a: No such file or directory
g++: error: /home/alex/work/c/clandmark/build/libclandmark/libclandmark.a: No such file or directory

In the build directories there are *.so files but not *.a, anyone knows how to resolve this?

Also when trying to run the examples, it needs "helpers.h" which however is not included in the build?

Compiling Mac OSX Binaries for MATLAB interface - errors

Hello,
Thanks for providing CLandMark. However, I couldn't compile successfully the Mac OSX Binaries for Matlab interface. Maybe, if you can provide theses ones for Mac OSX, I'll appreciate a lot.

I was facing a lot of errors, one of them was with the CType.h (https://github.com/uricamic/clandmark/blob/master/libclandmark/CTypes.h#L17 ) , where I read that I had to comment Line #17. But after doing "cmake install", I got this:

Building MEX extension /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.mexmaci64 Verbose mode is on. No MEX options file identified; looking for an implicit selection. ... Looking for compiler 'Xcode Clang++' ... ... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer'). ... Looking for folder '/Applications/Xcode.app/Contents/Developer' ...Yes. ... Executing command 'which xcrun' ...Yes ('/usr/bin/xcrun'). ... Looking for folder '/usr/bin' ...Yes. ... Executing command 'defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...Yes ('4.6.3'). ... Executing command ' agreed=4.6.3 if echo $agreed | grep -E '[\.\"]' >/dev/null; then lhs=expr "$agreed" : '([0-9])[.].' rhs=expr "$agreed" : '[0-9].$' if echo $rhs | grep -E '[\."]' >/dev/null; then rhs=expr "$rhs" : '([0-9])[.]._'`
fi
if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] && [ $rhs -ge 3 ] ); then
echo $agreed
else
exit 1
fi
fi' ...Yes ('4.6.3').
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...Yes.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...Yes.
... Executing command 'echo /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk | rev | cut -c1-10 | rev | egrep -oh '[0-9]+.[0-9]+'' ...Yes ('10.9').
Found installed compiler 'Xcode Clang++'.

Options file details

Compiler location: /Applications/Xcode.app/Contents/Developer
Options file: /Applications/MATLAB_R2014a.app/bin/maci64/mexopts/clang++_maci64.xml
CMDLINE100 : /usr/bin/xcrun -sdk macosx10.9 clang++ -c -DMATLAB_MEX_FILE  -I/Users/jadisha/Downloads/clandmark2/libclandmark  -I"/Applications/MATLAB_R2014a.app/extern/include" -I"/Applications/MATLAB_R2014a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fobjc-arc -O2 -DNDEBUG /Users/jadisha/Downloads/clandmark2/matlab_interface/featuresPool_interface_mex.cpp -o /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o
CMDLINE200 : /usr/bin/xcrun -sdk macosx10.9 clang++ -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.9 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -framework Cocoa -bundle  -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map" -O -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map" /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o   /Users/jadisha/Downloads/clandmark2/build/libclandmark/libflandmark.a /Users/jadisha/Downloads/clandmark2/build/libclandmark/libclandmark.a  -L"/Applications/MATLAB_R2014a.app/bin/maci64" -lmx -lmex -lmat -o /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.mexmaci64
CMDLINE300 : rm -f /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o
CXX : /usr/bin/xcrun -sdk macosx10.9 clang++
DEFINES : -DMATLAB_MEX_FILE 
MATLABMEX : -DMATLAB_MEX_FILE 
CXXFLAGS : -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fobjc-arc
INCLUDE : -I/Users/jadisha/Downloads/clandmark2/libclandmark  -I"/Applications/MATLAB_R2014a.app/extern/include" -I"/Applications/MATLAB_R2014a.app/simulink/include"
CXXOPTIMFLAGS : -O2 -DNDEBUG
CXXDEBUGFLAGS : -g
LDXX : /usr/bin/xcrun -sdk macosx10.9 clang++
LDFLAGS : -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.9 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -framework Cocoa -bundle  -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map"
LDBUNDLE : -bundle 
LINKEXPORT : -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map"
LINKLIBS : /Users/jadisha/Downloads/clandmark2/build/libclandmark/libflandmark.a /Users/jadisha/Downloads/clandmark2/build/libclandmark/libclandmark.a  -L"/Applications/MATLAB_R2014a.app/bin/maci64" -lmx -lmex -lmat
LDOPTIMFLAGS : -O
LDDEBUGFLAGS : -g
OBJEXT : .o
LDEXT : .mexmaci64
XCODE_DIR : /Applications/Xcode.app/Contents/Developer
XCRUN_DIR : /usr/bin
XCODE_AGREED_VERSION : 4.6.3
ISYSROOT : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
SDKVER : 10.9
MATLABROOT : /Applications/MATLAB_R2014a.app
ARCH : maci64
SRC : /Users/jadisha/Downloads/clandmark2/matlab_interface/featuresPool_interface_mex.cpp
OBJ : /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o
OBJS : /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o 
SRCROOT : /Users/jadisha/Downloads/clandmark2/matlab_interface/featuresPool_interface_mex
DEF : /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface.def
EXP : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.exp
LIB : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.lib
EXE : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.mexmaci64
ILK : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.ilk
MANIFEST : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.mexmaci64.manifest
TEMPNAME : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface
EXEDIR : /Users/jadisha/Downloads/clandmark2/build/matlab_interface/
EXENAME : featuresPool_interface
OPTIM : -O2 -DNDEBUG
LINKOPTIM : -O

Building with 'Xcode Clang++'.
/usr/bin/xcrun -sdk macosx10.9 clang++ -c -DMATLAB_MEX_FILE -I/Users/jadisha/Downloads/clandmark2/libclandmark -I"/Applications/MATLAB_R2014a.app/extern/include" -I"/Applications/MATLAB_R2014a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fobjc-arc -O2 -DNDEBUG /Users/jadisha/Downloads/clandmark2/matlab_interface/featuresPool_interface_mex.cpp -o /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o
/usr/bin/xcrun -sdk macosx10.9 clang++ -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.9 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -framework Cocoa -bundle -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map" -O -Wl,-exported_symbols_list,"/Applications/MATLAB_R2014a.app/extern/lib/maci64/mexFunction.map" /var/folders/q8/hc24__2x001_g1295456fn480000gn/T//mex_8738333904263_3010/featuresPool_interface_mex.o /Users/jadisha/Downloads/clandmark2/build/libclandmark/libflandmark.a /Users/jadisha/Downloads/clandmark2/build/libclandmark/libclandmark.a -L"/Applications/MATLAB_R2014a.app/bin/maci64" -lmx -lmex -lmat -o /Users/jadisha/Downloads/clandmark2/build/matlab_interface/featuresPool_interface.mexmaci64
clang: error: no such file or directory: '/Users/jadisha/Downloads/clandmark2/build/libclandmark/libflandmark.a'
clang: error: no such file or directory: '/Users/jadisha/Downloads/clandmark2/build/libclandmark/libclandmark.a'

make[2]: *** [matlab_interface/featuresPool_interface.mexmaci64] Error 255
make[1]: *** [matlab_interface/CMakeFiles/featuresPool_interface.dir/all] Error 2
make: *** [all] Error 2`

Also, when I tried to run the compile_mex.m file in Matlab, I got this:
`Error using mex
In file included from /Users/jadisha/Downloads/clandmark2/matlab_interface/flandmark_interface_mex.cpp:15:
In file included from ../libclandmark/Flandmark.h:14:
In file included from ../libclandmark/CLandmark.h:14:
In file included from ../libclandmark/CAppearanceModel.h:21:
In file included from ../3rd_party/CImg-1.5.6/CImg.h:9385:
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:129:13: warning: 9 enumeration values not handled in switch: 'mxUNKNOWN_CLASS',
'mxCELL_CLASS', 'mxSTRUCT_CLASS'... [-Wswitch]
switch (classID) {
^
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:205:39: error: cannot initialize a parameter of type 'mxClassID' with an lvalue of
type 'int'
if (nbdims>4 || !isNumericalClassID(classID)) {
^~~~~~~
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:98:41: note: passing argument to parameter 'id' here
static int isNumericalClassID(mxClassID id) {
^
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:270:13: warning: 9 enumeration values not handled in switch: 'mxUNKNOWN_CLASS',
'mxCELL_CLASS', 'mxSTRUCT_CLASS'... [-Wswitch]
switch (classID) {
^
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:129:13: warning: 9 enumeration values not handled in switch: 'mxUNKNOWN_CLASS',
'mxCELL_CLASS', 'mxSTRUCT_CLASS'... [-Wswitch]
switch (classID) {
^
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:192:5: note: in instantiation of member function 'cimg_library::CImg::makeImageFromMatlabData' requested here
makeImageFromMatlabData(matlabArray,classID);
^
/Users/jadisha/Downloads/clandmark2/matlab_interface/flandmark_interface_mex.cpp:128:37: note: in instantiation of member
function 'cimg_library::CImg::CImg' requested here
cimg_library::CImg img(prhs[2]);
^
In file included from /Users/jadisha/Downloads/clandmark2/matlab_interface/flandmark_interface_mex.cpp:15:
In file included from ../libclandmark/Flandmark.h:14:
In file included from ../libclandmark/CLandmark.h:14:
In file included from ../libclandmark/CAppearanceModel.h:21:
In file included from ../3rd_party/CImg-1.5.6/CImg.h:9385:
../3rd_party/CImg-1.5.6/plugins/cimgmatlab.h:270:13: warning: 9 enumeration values not handled in switch: 'mxUNKNOWN_CLASS',
'mxCELL_CLASS', 'mxSTRUCT_CLASS'... [-Wswitch]
switch (classID) {
^
/Users/jadisha/Downloads/clandmark2/matlab_interface/flandmark_interface_mex.cpp:841:18: note: in instantiation of member
function 'cimg_library::CImg::toMatlab' requested here
plhs[0] = nf->toMatlab(mxUINT8_CLASS);
^
4 warnings and 1 error generated.

Error in compile_mex (line 37)
eval(['mex -v -O -largeArrayDims flandmark_interface_mex.cpp ' include libclandmark ' -output ./mex/flandmark_interface']);`

I thank you in advance any help related to the correct installation of CLandmark in Mac OSX, especially for generating the .mex files for MATLAB.

Example precision?

Hello, thanks again for answering my last question, I think this is the last one.

I've used facial landmarks before but not this library, so I'm discovering it indeed :).

So, I tried to copy and paste your example in Xcode, the video_input.cpp. Just to be correct, I'm pasting it as I have it: (I just removed or added some irrelevant information):

int main( int argc, const char** argv )
{

    //CvCapture* capture = 0x0;
    //CvVideoWriter* writer = 0x0;
    VideoCapture capture;
    VideoWriter writer;

    Mat frame;

    double tic;
    bool saveoutput = false;
    string out_fname;

    Flandmark *flandmark = Flandmark::getInstanceOf(landmarks_path.c_str());

    //-- 1. Load the cascades
    if( !face_cascade.load( cascade_path ) )
    {
        cerr << "Couldn't load the haar cascade. Exiting..." << endl;
        return -1;
    };


    capture.open(0);
    // window
    namedWindow(window_name, CV_WINDOW_KEEPRATIO);
    //    namedWindow(window_name, WINDOW_KEEPRATIO);

    //-- 2. Read the video stream
    if( capture.isOpened() )
    {
        while( true )
        {
            tic = (double)getTickCount();

            capture >> frame;

            resize(frame, frame, Size(frame.size().width/3, frame.size().height/3));

            //-- 3. Apply the classifier to the frame
            if( !frame.empty() )
            {
                detectAndDisplay( frame, flandmark );

                tic = ((double)getTickCount() - tic)/getTickFrequency() * 1000;

                stringstream fps;
                fps << "fps: " << setprecision(4) << setw(4) << 1000.0 / tic << " ";
                putText(frame, fps.str(), Point(10, 25), CV_FONT_HERSHEY_COMPLEX, 1, Scalar(255, 255, 0));
                //              putText(frame, fps.str(), Point(10, 25), FONT_HERSHEY_COMPLEX, 1, Scalar(255, 255, 0));

                imshow( window_name, frame );

            } else {
                cerr << "No frame --- break." << endl;
                break;
            }

            if (saveoutput)
            {
                writer << frame;
            }

            int c = waitKey(10);
            if( (char)c == 'c' )
            {
                break;
            }
        }
    }

    delete flandmark;

    return 0;
}

and the result is this at the moment:

GIF:

clandmark

seems like flies around my face :)

Do you have any clue? these are the cascade and model:

string cascade_path = "haarcascade_frontalface_alt.xml";
string landmarks_path = "joint_mv_models/JOINT_MV_AFLW_SPLIT_1_frontal.xml";

thank you very much in advance.

Python Binding Error ...

Hi,

Whenever I tried to enable BUILD_PYTHON_BINDINGS , I obtained the following error messages:

CMake Error at python_interface/CMakeLists.txt:4 (find_package):
By not providing "Findclandmark.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"clandmark", but CMake did not find one.

Could not find a package configuration file provided by "clandmark" with
any of the following names:

 clandmarkConfig.cmake
 clandmark-config.cmake

Add the installation prefix of "clandmark" to CMAKE_PREFIX_PATH or set
"clandmark_DIR" to a directory containing one of the above files. If
"clandmark" provides a separate development package or SDK, be sure it has
been installed.

Any suggestions please??? Can't current clandmark-git bind with python?

Cheers
Pei

About LFW annotation

Hi, while looking through LFW annotation from flandmark github page, it contains 7 landmarks. However, provided flandmark_model.xml model contains 8 landmarks. What kind of model is used in LFW_annotation.txt?

Not understanding what bbox is

Hello, I've seen an example, for example the examples/video_input.cpp and I can see this when passing from cv::Rect (face_rect) to bbox:
bbox[0] = faces[i].x;
bbox[1] = faces[i].y;
bbox[2] = faces[i].x + faces[i].width;
bbox[3] = faces[i].y;
bbox[4] = faces[i].x + faces[i].width;
bbox[5] = faces[i].y + faces[i].height;
bbox[6] = faces[i].x;
bbox[7] = faces[i].y + faces[i].height;

the parameter 0 and 6 is the same, the parameter 1 and 3 is the same, 2 and 4, 5 and 7.

Why?

some error in building clandmark in visual studio

Hi, uricamic. I try to build the clandmark in vs2012 and vs2013. I've compiled the source code in CMake and added the opencv path. However, when I build the clandmark, there is the only .dll file. Then, I add the .def file and get the lib. But some error appear, there is the error:
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlNode::~XmlNode(void)" (??1XmlNode@clandmark@@QAE@XZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: class clandmark::XmlNode __thiscall clandmark::XmlNode::operator" (??AXmlNode@clandmark@@QAE?AV01@PBD@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: class std::vector > __thiscall clandmark::XmlNode::getSet(char const *)" (?getSet@XmlNode@clandmark@@QAE?AV?$vector@VXmlNode@clandmark@@v?$allocator@VXmlNode@clandmark@@@std@@@std@@pbd@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: unsigned char * __thiscall clandmark::XmlNode::readRaw(int *)" (?readRaw@XmlNode@clandmark@@QAEPAEPAH@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlNode::operator int(void)" (??BXmlNode@clandmark@@QAEHXZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlNode::operator double(void)" (??BXmlNode@clandmark@@QAENXZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlNode::operator class std::basic_string,class std::allocator >(void)" (??BXmlNode@clandmark@@QAE?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@xz) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlStorage::XmlStorage(class std::basic_string,class std::allocator >,enum clandmark::FILE_TYPE)" (??0XmlStorage@clandmark@@QAE@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@W4FILE_TYPE@1@@z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::XmlStorage::~XmlStorage(void)" (??1XmlStorage@clandmark@@QAE@XZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: class clandmark::XmlNode __thiscall clandmark::XmlStorage::operator" (??AXmlStorage@clandmark@@QAE?AVXmlNode@1@PBD@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CLandmark::CLandmark(int,int,int,int,double,double)" (??0CLandmark@clandmark@@QAE@HHHHNN@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(int,int,int,int,double,double)" (??0Flandmark@clandmark@@QAE@HHHHNN@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CLandmark::CLandmark(void)" (??0CLandmark@clandmark@@QAE@XZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: void __thiscall clandmark::CLandmark::init(int,int,int,int,double,double)" (?init@CLandmark@clandmark@@QAEXHHHHNN@Z) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CLandmark::~CLandmark(void)" (??1CLandmark@clandmark@@UAE@XZ) referenced in function __catch$?getInstanceOf@Flandmark@clandmark@@SAPAV12@PBD_N@Z$0
3>Flandmark.obj : error LNK2019: unresolved external symbol "public: void __thiscall clandmark::CLandmark::computeWdimension(void)" (?computeWdimension@CLandmark@clandmark@@QAEXXZ) referenced in function "public: __thiscall clandmark::Flandmark::Flandmark(int,int,int,int,double,double)" (??0Flandmark@clandmark@@QAE@HHHHNN@Z)
3>Flandmark.obj : error LNK2019: unresolved external symbol "protected: void __thiscall clandmark::CLandmark::setGroundTruth(double *)" (?setGroundTruth@CLandmark@clandmark@@IAEXPAN@Z) referenced in function __catch$?getInstanceOf@Flandmark@clandmark@@SAPAV12@PBD_N@Z$0
3>Flandmark.obj : error LNK2019: unresolved external symbol "protected: void __thiscall clandmark::CLandmark::getNormalizedFrame(struct cimg_library::CImg *,int *)" (?getNormalizedFrame@CLandmark@clandmark@@IAEXPAU?$CImg@E@cimg_library@@pah@Z) referenced in function __catch$?getInstanceOf@Flandmark@clandmark@@SAPAV12@PBD_N@Z$0
3>CSparseLBPFeatures.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CFeatures::CFeatures(int,int,int,int *)" (??0CFeatures@clandmark@@QAE@HHHPAH@Z) referenced in function "public: __thiscall clandmark::CSparseLBPFeatures::CSparseLBPFeatures(int,int,int,int *)" (??0CSparseLBPFeatures@clandmark@@QAE@HHHPAH@Z)
3>CSparseLBPFeatures.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CFeatures::~CFeatures(void)" (??1CFeatures@clandmark@@UAE@XZ) referenced in function "public: virtual __thiscall clandmark::CSparseLBPFeatures::~CSparseLBPFeatures(void)" (??1CSparseLBPFeatures@clandmark@@UAE@XZ)
3>CSparseLBPAppearanceModel.obj : error LNK2019: unresolved external symbol "public: void __thiscall clandmark::XmlStorage::writeRaw(void const *,int)" (?writeRaw@XmlStorage@clandmark@@QAEXPBXH@Z) referenced in function "public: virtual void __thiscall clandmark::CSparseLBPAppearanceModel::write(class clandmark::XmlStorage &,double * const,bool)const " (?write@CSparseLBPAppearanceModel@clandmark@@UBEXAAVXmlStorage@2@QAN_N@Z)
3>CDisplacementDeformationCost.obj : error LNK2001: unresolved external symbol "public: void __thiscall clandmark::XmlStorage::writeRaw(void const *,int)" (?writeRaw@XmlStorage@clandmark@@QAEXPBXH@Z)
3>CSparseLBPAppearanceModel.obj : error LNK2019: unresolved external symbol "class clandmark::XmlStorage & __cdecl clandmark::operator<<(class clandmark::XmlStorage &,class std::basic_string,class std::allocator > const &)" (??6clandmark@@YAAAVXmlStorage@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z) referenced in function "public: virtual void __thiscall clandmark::CSparseLBPAppearanceModel::write(class clandmark::XmlStorage &,double * const,bool)const " (?write@CSparseLBPAppearanceModel@clandmark@@UBEXAAVXmlStorage@2@QAN_N@Z)
3>CDisplacementDeformationCost.obj : error LNK2001: unresolved external symbol "class clandmark::XmlStorage & __cdecl clandmark::operator<<(class clandmark::XmlStorage &,class std::basic_string,class std::allocator > const &)" (??6clandmark@@YAAAVXmlStorage@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z)
3>CSparseLBPAppearanceModel.obj : error LNK2019: unresolved external symbol "class clandmark::XmlStorage & __cdecl clandmark::operator<<(class clandmark::XmlStorage &,int const &)" (??6clandmark@@YAAAVXmlStorage@0@AAV10@ABH@Z) referenced in function "public: virtual void __thiscall clandmark::CSparseLBPAppearanceModel::write(class clandmark::XmlStorage &,double * const,bool)const " (?write@CSparseLBPAppearanceModel@clandmark@@UBEXAAVXmlStorage@2@QAN_N@Z)
3>CDisplacementDeformationCost.obj : error LNK2001: unresolved external symbol "class clandmark::XmlStorage & __cdecl clandmark::operator<<(class clandmark::XmlStorage &,int const &)" (??6clandmark@@YAAAVXmlStorage@0@AAV10@ABH@Z)
3>CSparseLBPAppearanceModel.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CAppearanceModel::CAppearanceModel(int,int,int,int,int,int,int,class clandmark::CLoss *)" (??0CAppearanceModel@clandmark@@QAE@HHHHHHHPAVCLoss@1@@z) referenced in function "public: __thiscall clandmark::CSparseLBPAppearanceModel::CSparseLBPAppearanceModel(int,int,int,int,int,int,int,int,class clandmark::CLoss *)" (??0CSparseLBPAppearanceModel@clandmark@@QAE@HHHHHHHHPAVCLoss@1@@z)
3>CSparseLBPAppearanceModel.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CAppearanceModel::~CAppearanceModel(void)" (??1CAppearanceModel@clandmark@@UAE@XZ) referenced in function "public: virtual __thiscall clandmark::CSparseLBPAppearanceModel::~CSparseLBPAppearanceModel(void)" (??1CSparseLBPAppearanceModel@clandmark@@UAE@XZ)
3>CDisplacementDeformationCost.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CDeformationCost::CDeformationCost(class clandmark::CAppearanceModel * const,class clandmark::CAppearanceModel * const,class clandmark::CLoss * const)" (??0CDeformationCost@clandmark@@QAE@QAVCAppearanceModel@1@0QAVCLoss@1@@z) referenced in function "public: __thiscall clandmark::CDisplacementDeformationCost::CDisplacementDeformationCost(class clandmark::CAppearanceModel * const,class clandmark::CAppearanceModel * const,int)" (??0CDisplacementDeformationCost@clandmark@@QAE@QAVCAppearanceModel@1@0H@Z)
3>CDisplacementDeformationCost.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CDeformationCost::~CDeformationCost(void)" (??1CDeformationCost@clandmark@@UAE@XZ) referenced in function "public: virtual __thiscall clandmark::CDisplacementDeformationCost::~CDisplacementDeformationCost(void)" (??1CDisplacementDeformationCost@clandmark@@UAE@XZ)
3>CNormalizedEuclideanLoss.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CLoss::CLoss(int,int)" (??0CLoss@clandmark@@QAE@HH@Z) referenced in function "public: __thiscall clandmark::CNormalizedEuclideanLoss::CNormalizedEuclideanLoss(int,int)" (??0CNormalizedEuclideanLoss@clandmark@@QAE@HH@Z)
3>CTableLoss.obj : error LNK2001: unresolved external symbol "public: __thiscall clandmark::CLoss::CLoss(int,int)" (??0CLoss@clandmark@@QAE@HH@Z)
3>CZeroLoss.obj : error LNK2001: unresolved external symbol "public: __thiscall clandmark::CLoss::CLoss(int,int)" (??0CLoss@clandmark@@QAE@HH@Z)
3>CNormalizedEuclideanLoss.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CLoss::~CLoss(void)" (??1CLoss@clandmark@@UAE@XZ) referenced in function "public: virtual __thiscall clandmark::CNormalizedEuclideanLoss::~CNormalizedEuclideanLoss(void)" (??1CNormalizedEuclideanLoss@clandmark@@UAE@XZ)
3>CTableLoss.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall clandmark::CLoss::~CLoss(void)" (??1CLoss@clandmark@@UAE@XZ)
3>CZeroLoss.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall clandmark::CLoss::~CLoss(void)" (??1CLoss@clandmark@@UAE@XZ)
3>CTreeMaxSumSolver.obj : error LNK2019: unresolved external symbol "public: __thiscall clandmark::CMaxSumSolver::CMaxSumSolver(class std::vector > * const,class std::vector > * const,int,int)" (??0CMaxSumSolver@clandmark@@QAE@QAV?$vector@VVertex@clandmark@@v?$allocator@VVertex@clandmark@@@std@@@std@@qav?$vector@PAVCDeformationCost@clandmark@@v?$allocator@PAVCDeformationCost@clandmark@@@std@@@3@HH@Z) referenced in function "public: __thiscall clandmark::CTreeMaxSumSolver::CTreeMaxSumSolver(class std::vector > * const,class std::vector > * const,int,int)" (??0CTreeMaxSumSolver@clandmark@@QAE@QAV?$vector@VVertex@clandmark@@v?$allocator@VVertex@clandmark@@@std@@@std@@qav?$vector@PAVCDeformationCost@clandmark@@v?$allocator@PAVCDeformationCost@clandmark@@@std@@@3@HH@Z)
3>CTreeMaxSumSolver.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall clandmark::CMaxSumSolver::~CMaxSumSolver(void)" (??1CMaxSumSolver@clandmark@@UAE@XZ) referenced in function "public: virtual __thiscall clandmark::CTreeMaxSumSolver::~CTreeMaxSumSolver(void)" (??1CTreeMaxSumSolver@clandmark@@UAE@XZ)
3>D:\Program Files\clandmark\myclandmark\libclandmark\Debug\flandmark.dll : fatal error LNK1120: 30 unresolved externals

Can you help me?

Multi-view face landmark extraction

The output screenshots seem impressive, especially the multi view landmark extraction, but I can't figure out how to run it from the code you have provided. Please help.

Trying to run the example, what am I doing wrong?

Hi Michal,

I'm tying to run the example, and I'm getting this error:

$:~/clandmark/build/examples$ ./static_input 
Usage: static_input <path_to_haarcascade> <flandmark_model.xml> <input_image> [<output_image>]

feeding the parameters in the suggested order:

$:~/clandmark/build/examples$ ./static_input ./haarcascade_frontalface_alt.xml ./flandmark_model.xml ./face.jpg
Flandmark model loaded in 16.5043 ms
--(!)Error loading

Python bindings linux

There were a lot of problems with building project. For example cmake did not managed well headers file, but I avoided it by dirty copy past.
But that problem I dont understand.
I turned build shared libs
BUILD_SHARED_LIBS ON

but there is only libpy_flandmark.a file

[ 30%] Built target clandmark
[ 61%] Built target flandmark
[ 65%] Built target static_input
[ 69%] Built target video_input
[ 69%] Built target ReplicatePythonSourceTree
[ 76%] Built target py_featurePool
[ 84%] Built target py_flandmark
Copying python_interface/src/py_flandmark.so
Error copying file "/notebooks/clandmark/build/python_interface/src/py_flandmark.so" to "/notebooks/clandmark/build/python_interface/bin".
make[2]: *** [python_interface] Error 1
make[1]: *** [python_interface/src/CMakeFiles/python_interface.dir/all] Error 2
make: *** [all] Error 2

so, what additional info should I provide in order to answer the question "why there is no .so"

btw, I am working in docker to build that lib, and may be if I will manage to reliably build project I could make image for people to easily get acquainted with clandmark?

can't make the video_input example

/usr/bin/ld: CMakeFiles/video_input.dir/video_input.cpp.o: undefined reference to symbol '_ZN9clandmark9CLandmark6detectEPN12cimg_library4CImgIhEEPiPd'
/usr/local/lib/libclandmark.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [video_input] Error 1
make[1]: *** [CMakeFiles/video_input.dir/all] Error 2
make: *** [all] Error 2

When I run cmake ..
it runs fine but when I run make I get the following errors.
I am using CImg and Rapidxml which come with clandmark and I followed the installation instructions for clandmark from the website.

Rotation Tolerance

Hi Michal!

I have implemented Clandmark on a video stream, however, I noticed the following compared to Flandmark:

1- False positive rate is better, but still high, areas of white floor, or drawers always detected as a face!
2- Rotation tolerance, the Clandmark seems not to detect faces after certain rotation, to check on that, I used the provided image example, and ran the static program on the flipped version, no detection :(!
below is the results of the normal and flipped view
[http://postimg.org/image/5yqi37zlh/]

In one of your replies you mentioned that you were training a new model that is tolerated to rotation and yaw, is it done? do you have better models to be used, with better F measure (recall/precision).

Thanks!
Hayyan

PS: is the messages of "opengl support available" and "init done" from imshow or from the code? I couldn't find their source -_-'

Extracting Pitch, Roll and Yaw values

I have been able to run the Clandmark dense facial landmark detector example using OpenCV library on Windows 10. Is there any way (exposed functions) to extract the pitch, roll and yaw values of the face using the landmark positions?
Thanks!

clandmark vs flandmark

As I understand clandmark is new version of library.
But I saw usage flandmark in the same time with clandmark (static_input.cpp)
Why? Can we use only lastest version of clandmark?

Question on the green box

Hi! I am currently working your wonderful face detection program.
I want to ask how can I get/draw the green box as stated in the below screen capture?
image

Thank you very much for answering! It will mean a lot to me!

build error of flandmark

Hello.
I'm a japanese univ student and I'd like to use clandmark as a comparative method.
Since I usually use windows 7, I tried to build the clandmark using visual studio express 2015 for windows desktop after cmake.
However, it could not build flandmark and says many "unresolved external symbol" although clandmark is ok.
I describe some error messages below.

"public: __thiscall clandmark::XmlNode::~XmlNode(void)" (??1XmlNode@clandmark@@QAE@XZ) ใŒ้–ขๆ•ฐ "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z) ใงๅ‚็…งใ•ใ‚Œใพใ—ใŸใ€‚
"public: class clandmark::XmlNode __thiscall clandmark::XmlNode::operator[](char const *)" (??AXmlNode@clandmark@@QAE?AV01@PBD@Z) ใŒ้–ขๆ•ฐ "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z) ใงๅ‚็…งใ•ใ‚Œใพใ—ใŸใ€‚
"public: class std::vector<class clandmark::XmlNode,class std::allocator > __thiscall clandmark::XmlNode::getSet(char const *)" (?getSet@XmlNode@clandmark@@QAE?AV?$vector@VXmlNode@clandmark@@v?$allocator@VXmlNode@clandmark@@@std@@@std@@pbd@Z) ใŒ้–ขๆ•ฐ "public: __thiscall clandmark::Flandmark::Flandmark(char const *,bool)" (??0Flandmark@clandmark@@QAE@PBD_N@Z) ใงๅ‚็…งใ•ใ‚Œใพใ—ใŸใ€‚

Could you give me any advice?

core dumped

My OS is Ubuntu 14.04 LTS, OpenCV 2.4.11, CMake 3.5
๎‚ฐ ./video_input ./ flandmark_model.xml cam 0 ๎‚ฒ 10:01:06
It's OK. But when I want save the result.
๎‚ฐ ./video_input ./ flandmark_model.xml cam 0 output.avi ๎‚ฒ 10:02:01
HIGHGUI ERROR: V4L2: Unable to get property (5) - Invalid argument
OpenCV Error: Unspecified error (GStreamer: cannot link elements
) in CvVideoWriter_GStreamer::open, file /home/ren/Compile/OpenCV/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp, line 1396
terminate called after throwing an instance of 'cv::Exception'
what(): /home/ren/Compile/OpenCV/opencv-2.4.11/modules/highgui/src/cap_gstreamer.cpp:1396: error: (-2) GStreamer: cannot link elements
in function CvVideoWriter_GStreamer::open

[1] 19794 abort (core dumped) ./video_input ./ flandmark_model.xml cam 0 output.avi

CMake error

I'm trying to build clandmark on Ubuntu 14.04 but I get this error when I try to use ccmake

CMake Error at CMakeLists.txt:68 (export):
export Unknown arguments.

Line 68 from CMakeLists.txt contains the following command

export(EXPORT CLandmarkTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/clandmark/CLandmarkTargets.cmake"
NAMESPACE CLandmark::
)

I just followed the tutorial for Linux. What it can be done to fix this?

compilation error in clandmark

i have compiled the clandmark library using camke. i have opened clandmark.sln file and compiled it's shows the following.
image

kindly help to resolve the above mentioned error.

submission for pip

Do you plan to submit the application for inclusion in PyPI package index? This will greatly help users who want to use this nice library in Python.

Linux system error while example enabled

Hi there,

I am a new coder and I have been trying to get this library work for a week. Since it has Linux installation instruction, I even installed Linux for it.

Following the instructions I have made the compilation, however in the Linux installation tutorial, it disabled the example code generation, which means I still need to figure a way to compile a perfectly linked file. Not knowing how I tried to enable the example code cmake generation by turning it on, however it results in error during "make" step. My Cmake is 3.0.2 and to fit your program my opencv is 2.4.10.

I will greatly appreciate it if the problem can be solved or there are alternatives, I'm pasting the error message part below.

Linking CXX shared library libflandmark.so
[ 88%] Built target flandmark
Scanning dependencies of target static_input
[ 94%] Building CXX object examples/CMakeFiles/static_input.dir/static_input.cpp.o
make[2]: *** No rule to make target '/usr/share/opencv/lib/libopencv_videostab.so.2.4.11', needed by 'examples/static_input'. Stop.
CMakeFiles/Makefile2:165: recipe for target 'examples/CMakeFiles/static_input.dir/all' failed
make[1]: *** [examples/CMakeFiles/static_input.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

Thanks!

Questions about location of landmarks, normalised frame and bounding box

Hi, thanks for this great job and answering my last question.

I have modified the 'static_input' example using Jointly learned multi-view models.

After running below codes,
"printLandmarks(landmarks,flandmark->getLandmarksCount());" and
"printLandmarks(flandmark->getLandmarksNF(), flandmark->getLandmarksCount());",
there are 2 sets of numbers show in terminal (below is the screen capture of the 2 set of numbers).

screen shot 2016-03-02 at 2 05 18 am

Questions that I would like to ask are as follows.
(1)Which set of number representing the location of landmarks, i.e. x and y coordinate of a landmark? (2)Are the landmark locations based on a normalised frame?
(3)In 1 set of number, there are 2 rows(each row located between "[" and "]"), are the first number in each row represent the location of S01 and so on according to below picture captured from your paper?
screen shot 2016-03-02 at 2 24 22 am
(4)How can I get the normalised frame and draw the bounding box of the normalised frame just like the picture below?
screen shot 2016-03-02 at 2 30 44 am
(5) How can I get H and W? Are they equal to faces[i].x and faces[i].y or other?

I am sorry for asking so many questions.

Not able to load any Flandmark model

Hi, I followed the installation guide and I finished the installation.
However, I cannot load any flandmark model when I try the static_input example.

Here is the error:
screen shot 2015-10-27 at 8 35 18 am

and
screen shot 2015-10-27 at 8 34 40 am

I am using cmake version 3.0.2 and opencv version 3.0.0.

Thanks a lot.

Can we recognise half face without 1 eye?

Hi, thanks for this great jog and answering my last question.

I have run the 'static_input' example with the INDIVIDUAL_FRONTAL_AFLW_SPLIT_1.xml model, and find that the model can detect the faces with 2 eyes but not with only 1 eye. the results are as below.

successful result:
success

failed result:
fail1
fail2

I would like to know that

  1. can we detect the face with 1 eye using code snippet (http://cmp.felk.cvut.cz/~uricamic/clandmark/#snippets-mv) you provided?
  2. If yes, what model we should use in "modelDir" in the main function in the code snippet?

screen shot 2015-11-08 at 5 14 18 pm

double free or corruption using detect function of CLandmark

Hi Michal,
I hope you're ok. I already downloaded and compiled the library. I'm trying to integrate it in a C++ environment. With that on mind I took the code snippet on the web as basis and added the face detection code.
When I try to call the detect function the program hangs with message: double free or corruption. Using gdb I have found that, in particular, this problem arises in the call to solve function of the CTreeMaxSumSolver class. I believe, but I'm not completely sure, that this error doesn't arise in each any call to the function and the problem is with the last call to it.

This is the code I'm using to test the library:

#include "Flandmark.h"
#include "CFeaturePool.h"
#include "CSparseLBPFeatures.h"
#include "CImg.h"
#include "helpers.h"

#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

typedef float  fl_double_t;


/**
 * @brief LSBestLine
 * @param points
 * @param N
 * @return
 */
fl_double_t * LSBestLine(const fl_double_t *points, const int N)
{
    fl_double_t *line = new fl_double_t[2];

    fl_double_t mx = 0;
    fl_double_t my = 0;
    fl_double_t sumXminMx2 = 0;
    fl_double_t dotProd = 0;

    for (int i=0; i < N; ++i)
    {
        mx += points[INDEX(0, i, 2)];
        my += points[INDEX(1, i, 2)];
    }
    mx /= N;
    my /= N;

    for (int i=0; i < N; ++i)
    {
        fl_double_t tmp = (points[INDEX(0, i, 2)]-mx);
        dotProd += tmp*(points[INDEX(1, i, 2)]-my);
        sumXminMx2 += tmp*tmp;
    }
    dotProd /= sumXminMx2;

    line[1] = dotProd;
    line[0] = my - line[1]*mx;

    return line;
}

/**
 * @brief getUpdatedBBOX
 * @param P
 * @param N
 * @param bbox
 */
void getUpdatedBBOX(const fl_double_t *P, const int N, int *bbox)
{
    int left_eye[] = {42, 43, 44, 45, 46, 47};
    int right_eye[] = {36, 37, 38, 39, 40, 41};

    fl_double_t LeftEye[2] = {0, 0};
    fl_double_t RightEye[2] = {0, 0};
    fl_double_t CP[2] = {0, 0};

    fl_double_t eyes[2*13];
    for (int i=0; i < 6; ++i)
    {
        eyes[INDEX(0, i, 2)] = P[INDEX(0, left_eye[i], 2)];
        eyes[INDEX(1, i, 2)] = P[INDEX(1, left_eye[i], 2)];
        LeftEye[0] += P[INDEX(0, left_eye[i], 2)];
        LeftEye[1] += P[INDEX(1, left_eye[i], 2)];
        eyes[INDEX(0, i+7, 2)] = P[INDEX(0, right_eye[i], 2)];
        eyes[INDEX(1, i+7, 2)] = P[INDEX(1, right_eye[i], 2)];
        RightEye[0] += P[INDEX(0, right_eye[i], 2)];
        RightEye[1] += P[INDEX(1, right_eye[i], 2)];
    }
    eyes[INDEX(0, 6, 2)] = P[INDEX(0, 27, 2)];
    eyes[INDEX(1, 6, 2)] = P[INDEX(1, 27, 2)];
    LeftEye[0] /= 6;
    LeftEye[1] /= 6;
    RightEye[0] /= 6;
    RightEye[1] /= 6;

    fl_double_t *f2 = LSBestLine(eyes, 13);

    fl_double_t d = 0;
    d = sqrt( ((LeftEye[0]-RightEye[0])*(LeftEye[0]-RightEye[0])) + ((LeftEye[1]-RightEye[1])*(LeftEye[1]-RightEye[1])) );

    for (int i=0; i < N; ++i)
    {
        CP[0] += P[INDEX(0, i, 2)];
        CP[1] += P[INDEX(1, i, 2)];
    }
    CP[0] /= N;
    CP[1] /= N;

    fl_double_t ec = 2.7;

    fl_double_t bb_origin[8];
    bb_origin[0] = -d/2.0 * ec; bb_origin[2] =  d/2.0 * ec; bb_origin[4] = d/2.0 * ec; bb_origin[6] = -d/2.0 * ec;
    bb_origin[1] = -d/2.0 * ec; bb_origin[3] = -d/2.0 * ec; bb_origin[5] = d/2.0 * ec; bb_origin[7] =  d/2.0 * ec;

    fl_double_t X1[2] = {0, 0};
    fl_double_t X2[2] = {1, 0};
    fl_double_t vX[2] = {X2[0]-X1[0], X2[1]-X1[1]};
    fl_double_t A1[2] = {X1[0], f2[0]+f2[1]*X1[0]};
    fl_double_t A2[2] = {X2[0], f2[0]+f2[1]*X2[0]};
    fl_double_t vA[2] = {A2[0]-A1[0], A2[1]-A1[1]};

    fl_double_t ph;
    ph = atan2(vA[1], vA[0]);

    for (int i=0; i < 4; ++i)
    {
        bbox[INDEX(0, i, 2)] = (int)floor( cos(ph)*bb_origin[INDEX(0, i, 2)] - sin(ph)*bb_origin[INDEX(1, i, 2)] + CP[0] + 0.5 );
        bbox[INDEX(1, i, 2)] = (int)floor( sin(ph)*bb_origin[INDEX(0, i, 2)] + cos(ph)*bb_origin[INDEX(1, i, 2)] + CP[1] + 0.5 );
    }

    delete [] f2;
}

cimg_library::CImg<unsigned char> * cvImgToCImg(cv::Mat &cvImg)
        {
    cimg_library::CImg<unsigned char> * result = new cimg_library::CImg<unsigned char>(cvImg.cols, cvImg.rows);

    for (int x = 0; x < cvImg.cols; ++x)
        for (int y = 0; y < cvImg.rows; ++y)
            (*result)(x, y) = cvImg.at<uchar>(y, x);

    return result;
        }

cv::Mat & CImgtoCvImg(cv::Mat &result, cimg_library::CImg<unsigned char> *img)
{
    result = cv::Mat(img->height(), img->width(), CV_8U);

    for (int x=0; x < result.cols; ++x)
        for (int y=0; y < result.rows; ++y)
            result.at<uchar>(y, x) = (*img)(x, y);

    return result;
}

int main(int argc, char *argv[])
{
    fl_double_t *landmarks = 0x0;
    fl_double_t *coarse_landmarks = 0x0;
    int bbox[8], bbox_corrected[8];

    // Load image
    cimg_library::CImg<unsigned char> inputImage("../../examples/testImage.png");
    cimg_library::CImg<unsigned char> img_gray;

    // Convert to grayscale
    img_gray = inputImage.get_RGBtoYCbCr().get_channel(0);

    // initialization of C2F-DPM
    const char* CDPM_MODEL = "./models/CDPM.xml";
    const char* FDPM_MODEL = "./models/FDPM.xml";

    clandmark::Flandmark *CDPM = clandmark::Flandmark::getInstanceOf(CDPM_MODEL);
    clandmark::Flandmark *FDPM = clandmark::Flandmark::getInstanceOf(FDPM_MODEL);

    if (!CDPM || !FDPM)
    {

        std::cerr << "Couldn't create instance of C-DPM or F-DPM." << std::endl;
        return -1;
    }

    const int * bw_size = CDPM->getBaseWindowSize();
    clandmark::CFeaturePool * featuresPoolCDPM = new clandmark::CFeaturePool(bw_size[0], bw_size[1]);
    featuresPoolCDPM->addFeaturesToPool(
            new clandmark::CSparseLBPFeatures(featuresPoolCDPM->getWidth(),
                    featuresPoolCDPM->getHeight(),
                    featuresPoolCDPM->getPyramidLevels(),
                    featuresPoolCDPM->getCumulativeWidths())
    );
    CDPM->setNFfeaturesPool(featuresPoolCDPM);

    const int * bw_size2 = FDPM->getBaseWindowSize();
    clandmark::CFeaturePool * featuresPoolFDPM = new clandmark::CFeaturePool(bw_size2[0], bw_size2[1]);
    featuresPoolFDPM->addFeaturesToPool(
            new clandmark::CSparseLBPFeatures(featuresPoolFDPM->getWidth(),
                    featuresPoolFDPM->getHeight(),
                    featuresPoolFDPM->getPyramidLevels(),
                    featuresPoolFDPM->getCumulativeWidths())
    );
    FDPM->setNFfeaturesPool(featuresPoolFDPM);

    // Detect Face
    cv::Mat inputImageMat = cv::imread("../../examples/testImage.png");
    cv::Mat frame_gray;
    cv::cvtColor( inputImageMat, frame_gray, CV_BGR2GRAY );

    std::vector<cv::Rect> faces;
    cv::CascadeClassifier face_cascade;
    std::string face_cascade_name = "../../data/haarcascade_frontalface_alt.xml";
    if( !face_cascade.load( face_cascade_name ) ){ printf("--(!)Error loading\n"); return -1; };
    face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, cv::Size(30, 30) );
    for( uint32_t i = 0; i < faces.size(); i++ )
    {
        // Get detected face bounding box
        bbox[0] = faces[i].x;
        bbox[1] = faces[i].y;
        bbox[2] = faces[i].x+faces[i].width;
        bbox[3] = faces[i].y;
        bbox[4] = faces[i].x+faces[i].width;
        bbox[5] = faces[i].y+faces[i].height;
        bbox[6] = faces[i].x;
        bbox[7] = faces[i].y+faces[i].height;

        bbox_corrected[0] = faces[i].x;
        bbox_corrected[1] = faces[i].y;
        bbox_corrected[2] = faces[i].x+faces[i].width;
        bbox_corrected[3] = faces[i].y;
        bbox_corrected[4] = faces[i].x+faces[i].width;
        bbox_corrected[5] = faces[i].y+faces[i].height;
        bbox_corrected[6] = faces[i].x;
        bbox_corrected[7] = faces[i].y+faces[i].height;
        std::cout << " Index i is : " << "\n";
        std::cout << i << "\n";

    }
    // (skipped)
    // bbox in the following code contains detected face (e.g. by OpenCV face detector)
    // its format is [x_min, y_min, x_max, y_max]

    // --- C2F-DPM detector ---
    // Run the C-DPM detector
    CDPM->detect(&img_gray, &bbox[0]);
    // CDPM->detect_optimized(&img_gray, &bbox[0]);
    //CDPM->detect_optimized(img_gray, &bbox[0], 0);
    // Get detected landmarks
    coarse_landmarks = CDPM->getLandmarks();
    // Update face box
    getUpdatedBBOX(coarse_landmarks, CDPM->getLandmarksCount(), &bbox_corrected[0]);
    // Run the F-DPM detector
    FDPM->detect(&img_gray, &bbox_corrected[0]);
    //FDPM->detect_optimized(&img_gray, &bbox_corrected[0]);
    // Get detected landmarks
    landmarks = FDPM->getLandmarks();

    // Show landmarks
    // (skipped)

    // Cleanup
//  delete &inputImage;
//  delete &img_gray;
    delete CDPM;
    delete FDPM;
    delete featuresPoolCDPM;
    delete featuresPoolFDPM;
}

Negative out-of-bounds access in CTreeMaxSumSolver::dt1D

Hi,

I've just been trying to integrate CLandmark into a face detection app, pretty much following the example code (with some additional code from OpenCV to be able to process data from an iPad camera input source), and unfortunately it all comes to a halt when running through CTreeMaxSumSolver::dt1D(...) while in the following loop:

while (s <= z[k])
    k--;
    s = ((src[q*step] - src[v[k]*step]) - b*(q - v[k]) + a*(square(q) - square(v[k]))) / (2*a*(q-v[k]));
}

The reason for the halt is because s has become -Infinity, causing k to become negative.

This is using code as of latest in master (315c1e4).

Python API?

Thanks for sharing this great tool.

I understand from the README that the Python API is not ready for prime time.
You'd definitely win lots of users (including me :)) if it were available.

Are you still working on it?

more landmarks

Do you have tutorial howto modify/use library to detect more landmarks?

Thanks!

compiling using vs2013 no .lib file problem

compiling issue when i compiling flandmark i must have file clandmark.lib, however I only have clandmark.dll didn't have clandmark.lib file. And at last fail all the compiling.

Couldn't load the haar cascade

Hello! I tried to run the example for face detecting using camera with this command:

ilya@Asus-F83V:~/Downloads/opencv-3.1.0/workspace/clandmark/data$ ./../examples/examples/video_input haarcascade_frontalface_alt.xml flandmark_model.xml cam 0
Couldn't load the haar cascade. Exiting...

I run it from clandmark/data directory.

no face

I have problem with false positive detect face.
And when I give area really without face than library set landmarks anyway...

How to avoid such situation?

About Flandmark precision

Hi,
When i used flandmark_simple_example.m with flandmark_model.xml in data folder to detect facial points of a pic downloaded from internet, I found that the precision was not very well,especially the face was not frontal.
The result was not well using joint_mv_model and independent_mv_model also.
Is there any constraints about pic sizes? Or ,do you have more precisly model?
My pic sizes is 114*136.
Thank you.

running clandmark in windows

hi,
how can i run clandmakr in windows ?
please help me...i have downloaded clandmark_master file
what is the first thing i need to do in windows?

build error in VS under windows

Hey, I'm following the windows installation guide by screen shots
(http://cmp.felk.cvut.cz/~uricamic/clandmark/index.php?page=installation#install_windows)
And I've come to a stage where I tried and compile the VS project solution, after a (not so easy but) successful CMake configuration and generation. Now, when trying to build flandmark (or ALL_BUILD) I get:
clandmark

Both, for release and debug builds.
And indeed, I can't find the clanmark.lib file anywhere...

Again - CMake is done successfully, I am using Win7 64 bit VS2013 (VS12) CMake 3.0.2.

Missing 'CLandmarkConfig.h' on MATLAB wrapper

Hey, me again...

Now I'm trying to compile to MEX in MATLAB, and I get the following error:
clandmark

As I can see in the corresponding folder (/\libclanmark) - there is only a CLandmarkConfig.h.in file, and no "real" .h file.

Maybe I should CMake it all over with BUILD_MATLAB_BINDINGS set to ON?

There is an Version already compiled ?

Hello @uricamic ,

I'm anxious to use clandmark !! but I dont know how works language C++ , I'm working with Java,
and at the moment I use is flandmark provided by bytecode-presents ( an version JNI for JAVA )

Do you have estimate, when will release with support JNI ?

Another question: There is some version compiled from cflandmark ?

Thanks so much !

How to launch the example

Hi guys,

silly question: how to launch the example?

I compiled everything and now I can launch: clandmark/build$ ./examples/video_input
and I get: Usage: video_input <path_to_haarcasade> <flandmark_model.xml> { cam | vid } [ filename | cam_id ] [ output_filename ]

I've downloaded the learned models: independent_mv_models and joint_mv_models

So, how to launch? :)
Probably, It's written somewhere but I could not find it.

Please don't be harsh :-),

Gian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.