FaceApiTranslator

FaceApiTranslator

new FaceApiTranslator(config)

Source:

Constructor for the Azure FaceApi

Parameters:
Name Type Description
config object

Initial global configuration for the library, will be default values for some internal calls unless overwritten.

Properties
Name Type Attributes Default Description
subscriptionKey string

The subscription key.

personGroupId string <optional>

The email of the user.

recognitionModel string <optional>
'recognition_02'

The model for recognition. call

Methods

addImageToPerson(image) → {AxiosPromise}

Source:

Adds a face picture to a person

Parameters:
Name Type Description
image object

The image that you want to send to the API

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

personGroupId Group id that the person already belongs to, you can get this from the list personGroup or from the configuration in the app

personId string

The id of the person you are going to add the faces to

faceUrl string

The url from which you get the face

Returns:
Type
AxiosPromise

createNewPerson(person) → {AxiosPromise}

Source:

Creates a new person inside a person group

Parameters:
Name Type Description
person object

The person object that you want to send to the api

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

Group id that the person will belong to, you can get this from the list personGroup or from the configuration in the app

name string

Name of the person

userData object | string

Data of the person

Returns:
Type
AxiosPromise

createPersonGroup(personGroup) → {AxiosPromise}

Source:

This creates a group of persons, it cointains nothing more than a descriptive name, a description for the group and persons. The person group is the element that you are going to train when you want to be able to identify pictures in a group of people.

Parameters:
Name Type Description
personGroup

The person group details

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

The person group identifier

name string

The name that you will give to the group

userData string

The userData of the group

recognitionModel string <optional>
this.recognitionModel

The model to use when identifying people

Returns:
Type
AxiosPromise

detectAFace(face) → {AxiosPromise}

Source:

Gets a faceid that you can use later based on the image that you send

Parameters:
Name Type Description
face object

The face that you want to detect. You need to send either faceUrl or faceBlob

Properties
Name Type Attributes Default Description
returnFaceId boolean <optional>
true

returnFaceId

returnFaceLandmarks boolean <optional>
false

returnFaceLandmarks

recognitionModel string <optional>
this.recognitionModel

recognitionModel - The model to use when identifying people

returnRecognitionModel boolean <optional>
true

returnRecognitionModel

faceUrl string

The url that hosts the face of the person we are trying to use

faceBlob string

The blob containing the face (typically from a canvas.toBlob() function)

Returns:
Type
AxiosPromise

getPersonDetails(candidate) → {AxiosPromise}

Source:

Gets the person details from a person id in a group

Parameters:
Name Type Description
candidate object

Contains the candidate that has been found from the identification

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

Group that you know the person is in

personId string

Person id returned by the identify endpoint

Returns:
Type
AxiosPromise

getPersonGroup(opts) → {AxiosPromise}

Source:

Get a list of the person groups that you have in your account

Parameters:
Name Type Description
opts object

The search options

Properties
Name Type Attributes Default Description
top number <optional>
1000

The maximum groups

returnRecognitionModel boolean <optional>
true

Send true if you want to get the recognition model used per group

Returns:
Type
AxiosPromise

getTrainingStatus(optsopt) → {AxiosPromise}

Source:

Gets the status in which the training is

Parameters:
Name Type Attributes Description
opts object <optional>

The search options

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

personGroupId - Group id that you want to get the status of the training

Returns:
Type
AxiosPromise

identifyAPicture(dataopt, picture) → {AxiosPromise}

Source:

Gets the person id that matches the face that we detected

Parameters:
Name Type Attributes Description
data object <optional>

The payload that you send to the indentify endpoint

picture object

Contains the properties from the picture that you want to analise, mostly the faceId

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

personGroupId - Group that you know the person is in

faceIds array | string

Faces that you are trying to identify (you got this from the detect face endpoint)

candidates number <optional>
1

candidates - Candidates that can be proposed per face analysed

confidence number <optional>
0.4

confidence - Minimum confidence to have a candidate returned

Returns:
Type
AxiosPromise

trainPersonGroup(optsopt) → {AxiosPromise}

Source:

Trains the group to recognise it's faces

Parameters:
Name Type Attributes Description
opts object <optional>

The search options

Properties
Name Type Attributes Default Description
personGroupId string <optional>
this.personGroupId

Group id that you want to train

Returns:
Type
AxiosPromise