C++ Face Detector API

oneML model to detect faces in images, returning their confidence score, bounding box, face landmarks and poses.

class oneML::face::FaceDetector : public oneML::oneMLAPI

The oneML FaceDetector API object.

Class to create and use oneML face detector model.

Public Functions

explicit FaceDetector(oneML::LicenseManager &manager)

Construct a FaceDetector object.

Parameters

ReturnStatus detect(const MultiImage &imgs, std::vector<FaceDetectorResult> &results)

detect faces in images

Return

ReturnStatus: status of operation

Parameters
  • [in] imgs: vector of raw images

  • [out] results: vector of result objects

ReturnStatus detect(const MultiImage &imgs, float score_threshold, std::vector<FaceDetectorResult> &results)

detect faces in images

Return

ReturnStatus: status of operation

Parameters
  • [in] imgs: vector of raw images

  • [in] score_threshold: score threshold

  • [out] results: vector of result objects

ReturnStatus detect(const Image &img, FaceDetectorResult &result)

detect faces in images

Return

ReturnStatus: status of operation

Parameters
  • [in] img: raw image

  • [out] result: result object

ReturnStatus detect(const Image &img, float score_threshold, FaceDetectorResult &result)

detect faces in images

Return

ReturnStatus: status of operation

Parameters
  • [in] img: raw image

  • [in] score_threshold: score threshold

  • [out] result: result object

class oneML::face::FaceDetectorResult : public oneML::oneMLResult

The result object for oneML FaceDetector API.

Helper class to access all the results from an API call.

Public Functions

void get_scores(std::vector<float> &scores) const

get result score

Parameters
  • [out] scores: vector of scores

void get_bboxes(std::vector<oneML::face::BBox> &bboxes) const

get result bounding box

Parameters
  • [out] bboxes: vector of bounding boxes

void get_landmarks(std::vector<oneML::face::FaceLandmark5> &landmarks) const

get result landmarks

Parameters
  • [out] landmarks: vector of landmarks

void get_poses(std::vector<oneML::face::Pose> &poses) const

get result pose

Parameters
  • [out] poses: vector of poses

int get_size() const

get number of faces detected

Return

int: number of faces detected

std::vector<oneML::face::FaceDetectorStatus> get_return_status() const

get return status

Return

vector of return status

enum oneML::face::FaceDetectorStatus

A FaceDetectorStatus enum to use as return status.

Values:

enumerator Empty

Default return status.

enumerator Success

Success.

enumerator Fail

Fail.