Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

face detection compile issue


I am not so familiar with compiling cxx code especially by cmake

I can successfully compile interactive_face_detection_demo and run

But when I try to use it in my own project, I don't know what's going wrong

this is how I setup:

step 1:

    #copy all the header files I want to compile in one folder-----------------------------#

    mkdir openvino; cd openvino

    cp -r /opt/intel/openvino_2019.3.334/inference_engine/include/ie_* .

    cp -r /opt/intel/openvino_2019.3.334/inference_engine/include/cpp .

    cp -r /opt/intel/openvino_2019.3.334/inference_engine/include/multi-device .

    cp -r /opt/intel/openvino_2019.3.334/inference_engine/include/details .

    cp /opt/intel/openvino_2019.3.334/inference_engine/demos/interactive_face_detection_demo/detectors* .

    cp -r /opt/intel/openvino_2019.3.334/deployment_tools/open_model_zoo/demos/common/samples .

    #also all the .so files--------------------------------------------------------# 

    cd ..

    cp -r  /opt/intel/openvino_2019.3.334/deployment_tools/inference_engine/lib/intel64/ .   


step 2:

    #my own cpp file is like this--------------------------------------------------# 

    #include <cstdlib>
    #include <iostream>
    #include <vector>
    #include "detectors.hpp"
    #define FLAGS_m "/models/face-detection-retail-0004/FP32/face-detection-retail-0004.xml"
    #define FLAGS_d  "CPU"
    #define FLAGS_r  false
    #define FLAGS_async  false
    #define FLAGS_t  0.5
    #define FLAGS_bb_enlarge_coef  1.2
    #define FLAGS_dx_coef  1
    #define FLAGS_dy_coef  1

    using namespace InferenceEngine;

    extern "C" {

    void donothing(){
        FaceDetection faceDetector(FLAGS_m, FLAGS_d, 1, false, FLAGS_async, FLAGS_t, FLAGS_r,
           static_cast<float>(FLAGS_bb_enlarge_coef), static_cast<float>(FLAGS_dx_coef), static_cast<float>(FLAGS_dy_coef));
    }  // end

step 3:

    #my compile script--------------------------------------------------# 

    from setuptools import setup, Extension

            'cxxFunc', ['cxxFunc.cpp'],
            extra_compile_args=["-std=c++14", "-O3"],
            include_dirs=['.', '/opt/intel/openvino_2019.3.334/opencv/include', 'openvino', 
            library_dirs=['/opt/intel/openvino_2019.3.334/opencv/lib', 'intel64'],
                'opencv_highgui', 'opencv_video',
                'opencv_videoio', 'opencv_dnn', 'opencv_imgproc',
                'opencv_core', 'HDDLPlugin', 'HeteroPlugin', 'MKLDNNPlugin',
                'MultiDevicePlugin', 'clDNNPlugin', 'cpu_extension_avx2', 'inference_engine', 
                'cpu_extension_avx512', 'cpu_extension_sse4'

after these three steps, I just run "python3 install" and there is no error!!

but when I really run it, it shows error message "undefined symbol: _ZTV13FaceDetection"

I also have tried to link any .so files I can find in the dir openvino_2019.3.334 and it's no good

please anyone in the world helps me

0 Kudos
1 Reply

Hi ChiaCheng.

What's the full error listing? Do you use any Java references in your project? I've found out that _ZTV13FaceDetection component might be defined in one of libopencv_java*.so files.
I believe you should also include OpenCV libraries from openvino/opencv/lib/

If this does not work, then try to build your project first as an exact copy of Interactive Face Detection demo from
And if it's successful, then you could further implement additional components one by one into your project.

Also, please have a chance to try newest OpenVINO toolkit 2020.3 build with recommended versions of CMake and GCC that should be installed along with it.

Best regards, Max.