FaceAPI
Used for accessing Microsoft's Face API. Written for general use cases, not specifically for this application.
Constructor Summary
Public Constructor | ||
public |
constructor(key: string) creates an instance of FaceAPI |
Member Summary
Public Members | ||
public |
key: * type {number} |
Method Summary
Public Methods | ||
public |
addPersonFace(personGroupId: string, personId: string, image: Object, faceRectangle: Object): Object add a PersonFace to a Person |
|
public |
createPerson(personGroupId: string, name: string, userData: string): Object create a Person |
|
public |
createPersonGroup(personGroupId: string): Object creates a personGroup with name identical to the id. |
|
public |
deletePerson(personGroupId: string, personId: string): Object deletes a person |
|
public |
detects faces in an image |
|
public |
getPersonGroup(personGroupId: number): Object fetches a personGroup |
|
public |
getPersonGroupOrCreate(personGroupId: string): Object checks if personGroup exists and if it doesn't, creates it. |
|
public |
identifies persons from faceIds |
|
public |
listPersons(personGroupId: string): Object lists all Persons of a PersonGroup |
|
public |
makes a request to the API, used for simplifying. |
|
public |
setKey(key: *) type {string} |
|
public |
trainPersonGroup(personGroupId: string): Object trains a personGroup |
Public Constructors
Public Members
Public Methods
public addPersonFace(personGroupId: string, personId: string, image: Object, faceRectangle: Object): Object source
add a PersonFace to a Person
public createPerson(personGroupId: string, name: string, userData: string): Object source
create a Person
public createPersonGroup(personGroupId: string): Object source
creates a personGroup with name identical to the id.
Params:
Name | Type | Attribute | Description |
personGroupId | string |
public detect(image: blob): Object source
detects faces in an image
Params:
Name | Type | Attribute | Description |
image | blob |
public getPersonGroup(personGroupId: number): Object source
fetches a personGroup
Params:
Name | Type | Attribute | Description |
personGroupId | number |
public getPersonGroupOrCreate(personGroupId: string): Object source
checks if personGroup exists and if it doesn't, creates it.
Params:
Name | Type | Attribute | Description |
personGroupId | string |
public identify(personGroupId: string, faceIds: string[]): Object source
identifies persons from faceIds
public listPersons(personGroupId: string): Object source
lists all Persons of a PersonGroup
Params:
Name | Type | Attribute | Description |
personGroupId | string |
public makeRequest(endpoint: string, method: string, headers: Object, isImage: boolean): Object source
makes a request to the API, used for simplifying.
Params:
Name | Type | Attribute | Description |
endpoint | string | Endpoint to access in request |
|
method | string |
|
Method to use for request, e.g. GET, POST, PUT, etc. |
headers | Object |
|
Headers to send |
isImage | boolean |
|
If an image is in the body |