C++ Face Embedder Example

Initialize face embedder model

oneML::face::FaceEmbedder embedder;

Initialize face embedder model with licensing

oneML::LicenseManager license_manager;
license_manager.set_key("LICENSE_KEY_VALUE_HERE");
license_manager.activate_key();
oneML::face::FaceEmbedder embedder(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::FaceEmbedderResult> outputs;

Create oneML’s Image input and output object

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

Run the model

embedder.embed(inputs, outputs);

or

embedder.embed(img, output);

To enable flipped image embedding, run

embedder.embed(img, output, true);

And get the output

oneML::face:Embedding emb{};
output.get_embedding(emb);
int status = output.get_return_status();