C++ Face Structures

class oneML::Image

Class representing a single image.

Public Functions

Image() = default

Construct an Image object.

inline Image(uint16_t width, uint16_t height, uint8_t depth, std::shared_ptr<uint8_t> &data)

Construct an Image object.

Parameters
  • [in] width: image width

  • [in] height: image height

  • [in] depth: image depth

  • [in] data: pointer to image data

size_t size() const

This function returns the size of the image data.

Return

size_t size of image in bytes

void set_width(uint16_t value)

This function sets image width.

Parameters
  • [in] value: width value

void set_height(uint16_t value)

This function sets image height.

Parameters
  • [in] value: height value

void set_depth(uint16_t value)

This function sets image depth.

Parameters
  • [in] value: depth value

void set_data(uint8_t *value)

This function sets image data.

Parameters
  • [in] value: data pointer

uint16_t get_width() const

This function gets image width.

Return

uint16_t image width

uint16_t get_height() const

This function gets image height.

Return

uint16_t image height

uint16_t get_depth() const

This function gets image depth.

Return

uint16_t image depth

std::shared_ptr<uint8_t> get_data() const

This function gets image data pointer.

Return

std::shared_ptr<uint8_t> pointer to image data

using oneML::MultiImage = std::vector<Image>

Data structure representing a set images.

The set of faces passed to the template extraction process.

class oneML::ReturnStatus

A structure to contain information about a failure by the software under test.

An object of this class allows the software to return some information from a function call. The string within this object can be optionally set to provide more information for debugging etc. The status code will be set by the function to Success on success, or one of the other codes on failure.

Public Functions

inline ReturnStatus(const ReturnCode code, std::string info = "")

Create a ReturnStatus object.

Parameters
  • [in] code: ReturnCode enum

  • [in] info: optional information string

void set_code(ReturnCode value)

This function sets return code.

Parameters
  • [in] value: ReturnCode enum

void set_info(std::string value)

This function sets return info.

Parameters
  • [in] value: information string

ReturnCode get_code() const

This function gets return code.

Return

ReturnCode return code

std::string get_info() const

This function gets return info.

Return

std::string information string

enum oneML::ReturnCode

Return codes for functions specified in this API.

Values:

enumerator Success

Success.

enumerator UnknownError

Catch-all failure.

enumerator ConfigError

Error reading configuration files.

enumerator RefuseInput

Elective refusal to process the input.

enumerator ExtractError

Involuntary failure to process the image.

enumerator ParseError

Cannot parse the input data.

enumerator MemoryError

Memory allocation failed (e.g.

out of memory)

enumerator RuntimeError

Error while processing the input.

enumerator LicenseKeyError

License key is not valid.

enumerator NotImplemented

Failure to generate a quality score on the input image.

class oneML::BBox

Class for Bounding Box.

Public Functions

bool operator==(const BBox &bbox) const

This function compares two BBox for equality.

Return

boolean, true if BBoxes are the same, false otherwise

Parameters
  • [in] bbox: BBox to compare with

Public Members

float top = 0

BBox top coordinate.

float left = 0

BBox left coordinate.

float bottom = 0

BBox bottom coordinate.

float right = 0

BBox right coordinate.

template<int N>
struct oneML::face::FaceLandmark

Struct for landmark in face.

Public Functions

inline bool operator==(const FaceLandmark<N> &lm) const

check whether the given FaceLandmark is equal to this instance

Return

bool

Parameters

Public Members

std::array<float, N> x = {}

Array for x coordinates.

std::array<float, N> y = {}

Array for y coordinates.

using oneML::face::BBox = oneML::BBox
using oneML::face::Embedding = std::array<float, EMB_SIZE>
using oneML::face::FaceLandmark5 = FaceLandmark<N_LANDMARKS>
using oneML::face::FaceLandmark106 = FaceLandmark<N_LANDMARKS_106>
enum oneML::face::Pose

Return pose for detected face.

Values:

enumerator Front
enumerator Left
enumerator Right
enumerator Up
enumerator Down
enumerator Undefined