C++ Person Detector Example

Initialize person detector model

oneML::alpr::PersonDetector detector;

Initialize vehicle person model with licensing

oneML::LicenseManager license_manager;
license_manager.set_key("LICENSE_KEY_VALUE_HERE");
license_manager.activate_key();
oneML::alpr::PersonDetector 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::alpr::PersonDetectorResult> outputs;

Create oneML’s Image input and output object

oneML::Image img;
utils.read_image_cv(path, img);
oneML::alpr::PersonDetectorResult output;

Run the model

detector.detect(inputs, outputs);

or

detector.detect(img, output);

And get the output

std::vector<float> scores{};
std::vector<oneML::alpr::BBox> bboxes{};

output.get_scores(scores);
output.get_bboxes(bboxes);
int size = output.get_size();
std::vector<int> statuses = output.get_return_status();