.NET API Documentation

DemographicEstimator class

class DemographicEstimation.DemographicEstimator

The Demographic Estimator class

DemographicEstimator(string model_file, int max_concurrency)

DemographicEstimator constructor: loads model file, sets up the processing.

Parameters:
  • model_file (string) – path for the used model

  • max_concurrency (int) – maximum allowed concurrency, 0 means automatic (using all cores), default: 0

DetectFaces(ImageHeader img_hdr)

Detects the faces on an image. This method is async.

Parameters:

image (ImageHeader) – image of the face(s)

Return type:

Task<DetectResultsOrError>

Estimate(Face face)

Returns the demographic estimation of the detected face. This method is async.

Parameters:

face (Face) – face to embed.

Return type:

Task<EstimateResultsOrError>

Image header class

class DemographicEstimation.ImageHeader

The ImageHeader class

data: byte[]

Image data.

widht: int

Width of image.

height: int

Heigth of image.

stride: int

Stride of image.

format: ImageFormat

Format of image.

Result classes

Faces

class DemographicEstimation.Faces

Result wrapper class for internal Face list

Count()

Gets the number of Face objects held.

GetFace(int idx)

Gets one Face object from the internal list

Parameters:

idx (int) – index of Face object.

Return type:

Face

Face

class DemographicEstimation.Face
GetBoundingBox()

Returns the bounding box of the detected face.

Return type:

BoundingBox

GetConfidence()

Returns the confidence value of the detected face.

Return type:

float

BoundingBox

class DemographicEstimation.BoundingBox

The BoundingBox class

x: int

X coordinate of the top left corner.

y: int

Y coordinate of the top left corner.

width: int

Width of the bounding box.

height: int

Height of the bounding box.

Outputs

class DemographicEstimation.Outputs

Result wrapper class for internal Output list

Count()

Gets the number of Output objects held.

GetEstimation(int idx)

Gets one Output object from the internal list

Parameters:

idx (int) – index of Output object.

Return type:

Face

Output

class DemographicEstimation.Output

The Output class, contains one result of an Estimation

type: OutputType

Type of Estimation Output.

OutputType

class DemographicEstimation.OutputType
AGE = 0
GENDER = 1

Gender

class DemographicEstimation.Gender
FEMALE = 0
MALE = 1