Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Alim_S_
Beginner
47 Views

BUG interactive_face_detection_demo

In the example interactive_face_detection_demo there is an error in the detectors.cpp file in case of several faces

std::vector<float> FacialLandmarksDetection::operator[] (int idx) const {

....

    auto begin = n_lm * idx;
    auto end = begin + n_lm / 2;
    for (auto i_lm = begin; i_lm < end; ++i_lm) {
        float normed_x = normed_coordinates[2 * i_lm];
        float normed_y = normed_coordinates[2 * i_lm + 1];

        if (doRawOutputMessages) {
            std::cout << normed_x << ", " << normed_y << std::endl;
        }

        normedLandmarks.push_back(normed_x);
        normedLandmarks.push_back(normed_y);
    }

for fix, need to change to :

    auto begin = n_lm * idx;
    auto end = begin + n_lm;
    for(auto i_lm = begin; i_lm < end; i_lm += 2) 
    {
        float normed_x = normed_coordinates[i_lm];
        float normed_y = normed_coordinates[i_lm + 1];
        normedLandmarks.push_back(normed_x);
        normedLandmarks.push_back(normed_y);
    }

#endif
 

0 Kudos
0 Replies