C++ Face Landmark Example

Initialize face landmark model

oneML::face::FaceLandmarkDetector landmark_detector;

Initialize face landmark model with licensing

oneML::LicenseManager license_manager;
license_manager.set_key("LICENSE_KEY_VALUE_HERE");
license_manager.activate_key();
oneML::face::FaceLandmarkDetector landmark_detector(license_manager);

Initialize oneML’s Utils

oneML::Utils utils;

Initialize oneML’s Utils with licensing

oneML::Utils utils(license_manager);

Create oneML’s MultiImage input and outputs object

oneML::MultiImage inputs{img1, img2, ...  img4};
std::vector<oneML::face::FaceLandmarkResult> outputs;

Create oneML’s Image input and output object

oneML::Image img;
utils.read_image_cv(path, img);
oneML::face::FaceLandmarkResult output;

Run the model

landmark_detector.detect(inputs, outputs);

or

landmark_detector.detect(img, output);

And get the output

FaceLandmark106 landmarks;

output.get_landmarks(landmarks);
int status = output.get_return_status();