C++ License Plate Detector Example

Initialize license plate detector model

oneML::alpr::LicensePlateDetector detector;

Initialize license plate person model with licensing

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

Create oneML’s Image input and output object

oneML::Image img;
utils.read_image_cv(path, img);
oneML::alpr::LicensePlateDetectorResult 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();