This package contains a set of intelligent APIs understanding images: It can detect and analyze people's faces, their age, gender, and similarity. It can identify people based on a set of images. It can understand what is displayed in a picture and crop it according to where the important features are. It can tell you whether an image contains adult content, what the main colors are, and which of your images belong in a group. If your image features text, it will tell you the language and return the text as a string. It's basically magic. For more details on the Project Oxford API, please visit projectoxford.ai.
This Node module implements Project Oxford's API for Faces, Vision, Text, and WebLM.
To install this package, run npm install --save project-oxford
and obtain an API key. To obtain such a key, you will also need an (free) Microsoft Azure Account. Once you got your key, you can instantiate an Oxford client in your code:
var oxford = require('project-oxford'),
client = new oxford.Client('7fb073s72bh72663y5ddh129m12e598d');
Now that you got your client running, you're ready to do some pretty smart stuff. Have a picture of a person and want a computed guess of their age and gender?
client.face.detect({
path: 'myFolder/myFace.jpg',
analyzesAge: true,
analyzesGender: true
}).then(function (response) {
console.log('The age is: ' + response[0].faceAttributes.age);
console.log('The gender is: ' + response[0].faceAttributes.gender);
});
Have a picture of a person and want a computed guess about their emotions?
client.emotion.analyzeEmotion({
path: './myFace.jpg',
}).then(function (response) {
console.log(response);
});
Or, you can add the rectangle of the face yourself, in the form "left,top,width,height". Delimited multiple face rectangles with a “;”.
client.emotion.analyzeEmotion({
path: './myFace.jpg',
faceRectangles: '10, 10, 100, 100'
}).then(function (response) {
console.log(response);
});
Creating a smart-cropped thumbnail:
client.vision.thumbnail({
path: './photo.jpg',
height: 150,
width: 150,
smartCropping: true,
pipe: fs.createWriteStream('./photo2.jpg')
});
Running OCR on an image, returning the text on the image:
client.vision.ocr({
path: './test/images/ocr.jpg',
language: 'en'
}).then(function (response) {
console.log(response.body);
});
For the full documentation, please see the API reference below.
Kind: global class
- Client
- new Client(key, hostOrRegion)
- .emotion :
object
- ~analyzeEmotion(options) ⇒
Promise
- ~analyzeEmotion(options) ⇒
- .face :
object
- static
- .faceList :
object
- .list() ⇒
Promise
- .create(faceListId, options) ⇒
Promise
- .update(faceListId, options) ⇒
Promise
- .delete(faceListId) ⇒
Promise
- .get(faceListId) ⇒
Promise
- .addFace(faceListId, options) ⇒
Promise
- .deleteFace(faceListId, persistedFaceId) ⇒
Promise
- .list() ⇒
- .personGroup :
object
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId) ⇒
Promise
- .get(personGroupId) ⇒
Promise
- .trainingStatus(personGroupId) ⇒
Promise
- .trainingStart(personGroupId) ⇒
Promise
- .update(personGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
- .person :
object
- .addFace(personGroupId, personId, options) ⇒
Promise
- .deleteFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(personGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId, personId) ⇒
Promise
- .get(personGroupId, personId) ⇒
Promise
- .update(personGroupId, personId, name, userData) ⇒
Promise
- .list(personGroupId) ⇒
Promise
- .addFace(personGroupId, personId, options) ⇒
- .largePersonGroup :
object
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId) ⇒
Promise
- .get(largePersonGroupId) ⇒
Promise
- .trainingStatus(largePersonGroupId) ⇒
Promise
- .trainingStart(largePersonGroupId) ⇒
Promise
- .update(largePersonGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
- .largePersonGroupPerson :
object
- .addFace(largePersonGroupId, personId, options) ⇒
Promise
- .deleteFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(largePersonGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId, personId) ⇒
Promise
- .get(largePersonGroupId, personId) ⇒
Promise
- .update(largePersonGroupId, personId, name, userData) ⇒
Promise
- .list(largePersonGroupId) ⇒
Promise
- .addFace(largePersonGroupId, personId, options) ⇒
- .faceList :
- inner
- ~detect(options) ⇒
Promise
- ~similar(sourceFace, options) ⇒
Promise
- ~grouping(faces) ⇒
Promise
- ~identify(faces, options) ⇒
Promise
- ~verify(faces) ⇒
Promise
- ~detect(options) ⇒
- static
- .text :
object
- .vision :
object
- static
- .result
- .get(operation) ⇒
Promise
- .get(operation) ⇒
- .models :
object
- .list() ⇒
Promise
- .analyzeImage(model, options) ⇒
Promise
- .list() ⇒
- .result
- inner
- ~analyzeImage(options) ⇒
Promise
- ~thumbnail(options) ⇒
Promise
- ~ocr(options) ⇒
Promise
- ~recognizeText(options) ⇒
Promise
- ~analyzeImage(options) ⇒
- static
- .weblm :
object
- ~listModels() ⇒
Promise
- ~breakIntoWords(model, text, options) ⇒
Promise
- ~generateWords(model, words, options) ⇒
Promise
- ~getJointProbabilities(model, phrases, order) ⇒
Promise
- ~getConditionalProbabilities(model, queries, order) ⇒
Promise
- ~listModels() ⇒
Creates a new Project Oxford Client using a given API key.
Param | Type | Description |
---|---|---|
key | string |
Project Oxford API Key |
hostOrRegion | string |
Optional host address or region |
Kind: static namespace of Client
Analyze the emotions of one or more faces in an image.
Kind: inner method of emotion
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | Object |
Options object |
options.url | string |
URL to the image file |
options.path | string |
URL to a local image file |
options.data | string |
Image as a binary buffer |
options.faceRectangles | Array.<Object> |
Array of face rectangles. Face rectangles are returned in the face.detect and vision.analyzeImage methods. |
Kind: static namespace of Client
- .face :
object
- static
- .faceList :
object
- .list() ⇒
Promise
- .create(faceListId, options) ⇒
Promise
- .update(faceListId, options) ⇒
Promise
- .delete(faceListId) ⇒
Promise
- .get(faceListId) ⇒
Promise
- .addFace(faceListId, options) ⇒
Promise
- .deleteFace(faceListId, persistedFaceId) ⇒
Promise
- .list() ⇒
- .personGroup :
object
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId) ⇒
Promise
- .get(personGroupId) ⇒
Promise
- .trainingStatus(personGroupId) ⇒
Promise
- .trainingStart(personGroupId) ⇒
Promise
- .update(personGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
- .person :
object
- .addFace(personGroupId, personId, options) ⇒
Promise
- .deleteFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(personGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId, personId) ⇒
Promise
- .get(personGroupId, personId) ⇒
Promise
- .update(personGroupId, personId, name, userData) ⇒
Promise
- .list(personGroupId) ⇒
Promise
- .addFace(personGroupId, personId, options) ⇒
- .largePersonGroup :
object
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId) ⇒
Promise
- .get(largePersonGroupId) ⇒
Promise
- .trainingStatus(largePersonGroupId) ⇒
Promise
- .trainingStart(largePersonGroupId) ⇒
Promise
- .update(largePersonGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
- .largePersonGroupPerson :
object
- .addFace(largePersonGroupId, personId, options) ⇒
Promise
- .deleteFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(largePersonGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId, personId) ⇒
Promise
- .get(largePersonGroupId, personId) ⇒
Promise
- .update(largePersonGroupId, personId, name, userData) ⇒
Promise
- .list(largePersonGroupId) ⇒
Promise
- .addFace(largePersonGroupId, personId, options) ⇒
- .faceList :
- inner
- ~detect(options) ⇒
Promise
- ~similar(sourceFace, options) ⇒
Promise
- ~grouping(faces) ⇒
Promise
- ~identify(faces, options) ⇒
Promise
- ~verify(faces) ⇒
Promise
- ~detect(options) ⇒
- static
Kind: static namespace of face
- .faceList :
object
- .list() ⇒
Promise
- .create(faceListId, options) ⇒
Promise
- .update(faceListId, options) ⇒
Promise
- .delete(faceListId) ⇒
Promise
- .get(faceListId) ⇒
Promise
- .addFace(faceListId, options) ⇒
Promise
- .deleteFace(faceListId, persistedFaceId) ⇒
Promise
- .list() ⇒
Lists the faceListIds, and associated names and/or userData.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Creates a new face list with a user-specified ID. A face list is a list of faces associated to be associated with a given person.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faceListId | string |
Numbers, en-us letters in lower case, '-', '_'. Max length: 64 |
options | object |
Optional parameters |
options.name | string |
Name of the face List |
options.userData | string |
User-provided data associated with the face list. |
Creates a new person group with a user-specified ID. A person group is one of the most important parameters for the Identification API. The Identification searches person faces in a specified person group.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faceListId | string |
Numbers, en-us letters in lower case, '-', '_'. Max length: 64 |
options | object |
Optional parameters |
options.name | string |
Name of the face List |
options.userData | string |
User-provided data associated with the face list. |
Deletes an existing person group.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faceListId | string |
ID of face list to delete |
Gets an existing face list.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faceListId | string |
ID of face list to retrieve |
Gets an existing face list.
Kind: static method of faceList
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faceListId | string |
ID of face list to retrieve |
options | object |
Options object |
options.url | string |
URL to image to be used |
options.path | string |
Path to image to be used |
options.data | string |
Image as a binary buffer |
options.name | string |
Optional name for the face |
options.userData | string |
Optional user-data for the face |
options.targetFace | string |
Optional face rectangle to specify the target face to be added into the face list, in the format of "targetFace=left,top,width,height". |
Delete a face from the face list. The face ID will be an ID returned in the addFace method, not from the detect method.
Kind: static method of faceList
Returns: Promise
- - Promise; successful response is empty
Param | Type | Description |
---|---|---|
faceListId | string |
ID of face list to retrieve |
persistedFaceId | string |
ID of face in the face list |
Kind: static namespace of face
- .personGroup :
object
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId) ⇒
Promise
- .get(personGroupId) ⇒
Promise
- .trainingStatus(personGroupId) ⇒
Promise
- .trainingStart(personGroupId) ⇒
Promise
- .update(personGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
Creates a new person group with a user-specified ID. A person group is one of the most important parameters for the Identification API. The Identification searches person faces in a specified person group.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Numbers, en-us letters in lower case, '-', '_'. Max length: 64 |
name | string |
Person group display name. The maximum length is 128. |
userData | string |
User-provided data attached to the group. The size limit is 16KB. |
Deletes an existing person group.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Name of person group to delete |
Gets an existing person group.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Name of person group to get |
Retrieves the training status of a person group. Training is triggered by the Train PersonGroup API. The training will process for a while on the server side. This API can query whether the training is completed or ongoing.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Name of person group to get |
Starts a person group training. Training is a necessary preparation process of a person group before identification. Each person group needs to be trained in order to call Identification. The training will process for a while on the server side even after this API has responded.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Name of person group to get |
Updates an existing person group's display name and userData.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
Numbers, en-us letters in lower case, '-', '_'. Max length: 64 |
name | string |
Person group display name. The maximum length is 128. |
userData | string |
User-provided data attached to the group. The size limit is 16KB. |
List person groups’s pesonGroupId, name, and userData.
Kind: static method of personGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | object |
List opentions |
options.start | string |
List person groups from the least personGroupId greater than the "start". It contains no more than 64 characters. Default is empty. |
options.top | integer |
The number of person groups to list, ranging in [1, 1000]. Default is 1000. |
Kind: static namespace of face
- .person :
object
- .addFace(personGroupId, personId, options) ⇒
Promise
- .deleteFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(personGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(personGroupId, personId, persistedFaceId) ⇒
Promise
- .create(personGroupId, name, userData) ⇒
Promise
- .delete(personGroupId, personId) ⇒
Promise
- .get(personGroupId, personId) ⇒
Promise
- .update(personGroupId, personId, name, userData) ⇒
Promise
- .list(personGroupId) ⇒
Promise
- .addFace(personGroupId, personId, options) ⇒
Adds a face to a person for identification. The maximum face count for each person is 248.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person that the face is added to. |
options | object |
The source specification. |
options.url | string |
URL to image to be used. |
options.path | string |
Path to image to be used. |
options.data | string |
Image as a binary buffer |
options.userData | string |
Optional. Attach user data to person's face. The maximum length is 1024. |
options.targetFace | object |
Optional. The rectangle of the face in the image. |
Deletes a face from a person.
Kind: static method of person
Returns: Promise
- - Promise; successful response is empty
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person that the face is removed from. |
persistedFaceId | string |
The ID of the face to be deleted. |
Updates a face for a person.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person that the face is updated on. |
persistedFaceId | string |
The ID of the face to be updated. |
userData | string |
Optional. Attach user data to person's face. The maximum length is 1024. |
Get a face for a person.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person that the face is to get from. |
persistedFaceId | string |
The ID of the face to get. |
Creates a new person in a specified person group for identification. The number of persons has a subscription limit. Free subscription amount is 1000 persons.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
name | string |
Target person's display name. The maximum length is 128. |
userData | string |
Optional fields for user-provided data attached to a person. Size limit is 16KB. |
Deletes an existing person from a person group.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person to delete. |
Gets an existing person from a person group.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person to get. |
Updates a person's information.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
personId | string |
The target person's id. |
name | string |
Target person's display name. The maximum length is 128. |
userData | string |
Optional fields for user-provided data attached to a person. Size limit is 16KB. |
Lists all persons in a person group, with the person information.
Kind: static method of person
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
personGroupId | string |
The target person's person group. |
options.start | string |
List persons from the least personId greater than the "start". It contains no more than 64 characters. Default is empty. |
options.top | Number |
Optional count of persons to return. Valid range is [1,1000]. (Default: 1000) |
Kind: static namespace of face
- .largePersonGroup :
object
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId) ⇒
Promise
- .get(largePersonGroupId) ⇒
Promise
- .trainingStatus(largePersonGroupId) ⇒
Promise
- .trainingStart(largePersonGroupId) ⇒
Promise
- .update(largePersonGroupId, name, userData) ⇒
Promise
- .list(options) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
Create a new large person group with user-specified largePersonGroupId, name, and optional userData. A large person group is the container of the uploaded person data, including face images and face recognition feature, and up to 1,000,000 people. The Identify() method searches person faces in a specified large person group.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
Numbers, en-us letters in lower case, '-', '_'. Max length: 64 |
name | string |
Person group display name. The maximum length is 128. |
userData | string |
User-provided data attached to the group. The size limit is 16KB. |
Deletes an existing large person group.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
ID of large person group to delete |
Gets an existing large person group.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
ID of large person group to get |
To check large person group training status completed or still ongoing. LargePersonGroup Training is an asynchronous operation triggered by LargePersonGroup - Train API. Training time depends on the number of person entries, and their faces in a large person group. It could be in seconds, or up to half an hour for 1,000,000 persons.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
ID of large person group to get |
Submit a large person group training task. Training is a crucial step that only a trained large person group can be used by Face - Identify. The training task is an asynchronous task. Training time depends on the number of person entries, and their faces in a large person group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check training completion, please use LargePersonGroup - Get Training Status.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
ID of large person group to get |
Update an existing large person group's name and userData. The properties keep unchanged if they are not in request body.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
ID of large person group to update |
name | string |
Person group display name. The maximum length is 128. |
userData | string |
User-provided data attached to the group. The size limit is 16KB. |
List all existing large person groups’s largePesonGroupId, name, and userData.
Kind: static method of largePersonGroup
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | object |
List opentions |
options.start | string |
List large person groups from the least largePersonGroupId greater than the "start". It contains no more than 64 characters. Default is empty. |
options.top | integer |
The number of large person groups to list, ranging in [1, 1000]. Default is 1000. |
Kind: static namespace of face
- .largePersonGroupPerson :
object
- .addFace(largePersonGroupId, personId, options) ⇒
Promise
- .deleteFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .updateFace(largePersonGroupId, personId, persistedFaceId, userData) ⇒
Promise
- .getFace(largePersonGroupId, personId, persistedFaceId) ⇒
Promise
- .create(largePersonGroupId, name, userData) ⇒
Promise
- .delete(largePersonGroupId, personId) ⇒
Promise
- .get(largePersonGroupId, personId) ⇒
Promise
- .update(largePersonGroupId, personId, name, userData) ⇒
Promise
- .list(largePersonGroupId) ⇒
Promise
- .addFace(largePersonGroupId, personId, options) ⇒
Add a face image to a person into a large person group for face identification or verification. Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person that the face is added to. |
options | object |
The source specification. |
options.url | string |
URL to image to be used. |
options.path | string |
Path to image to be used. |
options.data | string |
Image as a binary buffer |
options.userData | string |
Optional. Attach user data to person's face. The maximum length is 1024. |
options.targetFace | object |
Optional. The rectangle of the face in the image. |
Delete a face from a person in a large person group. Face data and image related to this face entry will be also deleted. Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise; successful response is empty
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person that the face is removed from. |
persistedFaceId | string |
The ID of the face to be deleted. |
largePersonGroupPerson.updateFace(largePersonGroupId, personId, persistedFaceId, userData) ⇒ Promise
Update a person persisted face's userData field.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person that the face is updated on. |
persistedFaceId | string |
The ID of the face to be updated. |
userData | string |
Optional. Attach user data to person's face. The maximum length is 1024. |
Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and persistedFaceId.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person that the face is to get from. |
persistedFaceId | string |
The ID of the face to get. |
Create a new person in a specified large person group. To add face to this person, please call LargePersonGroup PersonFace - Add. The number of persons has a subscription limit. Free subscription amount is 1000 persons.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
name | string |
Target person's display name. The maximum length is 128. |
userData | string |
Optional fields for user-provided data attached to a person. Size limit is 16KB. |
Delete an existing person from a large person group. All stored person data, and face images in the person entry will be deleted.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person to delete. |
Retrieve a person's name and userData, and the persisted faceIds representing the registered person face image.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person to get. |
Updates a person's information.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
largePersonGroupId of the target large person group. |
personId | string |
The target person's id. |
name | string |
Target person's display name. The maximum length is 128. |
userData | string |
Optional fields for user-provided data attached to a person. Size limit is 16KB. |
List all persons’ information in the specified large person group, including personId, name, userData and persistedFaceIds of registered person faces.
Kind: static method of largePersonGroupPerson
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
largePersonGroupId | string |
The target person's person group. |
options.start | string |
List persons from the least personId greater than the "start". It contains no more than 64 characters. Default is empty. |
options.top | Number |
Optional count of persons to return. Valid range is [1,1000]. (Default: 1000) |
Call the Face Detected API Detects human faces in an image and returns face locations, face landmarks, and optional attributes including head-pose, gender, and age. Detection is an essential API that provides faceId to other APIs like Identification, Verification, and Find Similar.
Kind: inner method of face
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | object |
Options object |
options.url | string |
URL to image to be used |
options.path | string |
Path to image to be used |
options.data | string |
Image as a binary buffer |
options.returnFaceId | boolean |
Include face ID in response? |
options.analyzesAccessories | boolean |
Analyze accessories? |
options.analyzesAge | boolean |
Analyze age? |
options.analyzesBlur | boolean |
Analyze blur? |
options.analyzesEmotion | boolean |
Analyze emotions? |
options.analyzesExposure | boolean |
Analyze expose? |
options.analyzesFaceLandmarks | boolean |
Analyze face landmarks? |
options.analyzesFacialHair | boolean |
Analyze facial hair? |
options.analyzesGender | boolean |
Analyze gender? |
options.analyzesGlasses | boolean |
Analyze glasses? |
options.analyzesHair | boolean |
Analyze hair? |
options.analyzesHeadPose | boolean |
Analyze headpose? |
options.analyzesMakeup | boolean |
Analyze makeup? |
options.analyzesNoise | boolean |
Analyze noise? |
options.analyzesOcclusion | boolean |
Analyze occlusion? |
options.analyzesSmile | boolean |
Analyze smile? |
Detect similar faces using faceIds (as returned from the detect API), or faceListId (as returned from the facelist API).
Kind: inner method of face
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
sourceFace | string |
String of faceId for the source face |
options | object |
Options object |
options.candidateFaces | Array.<string> |
Array of faceIds to use as candidates |
options.candidateFaceListId | string |
Id of face list, created via FaceList.create |
options.maxCandidates | Number |
Optional max number for top candidates (default is 20, max is 20) |
options.mode | string |
Optional face searching mode. It can be "matchPerson" or "matchFace" (default is "matchPerson") |
Divides candidate faces into groups based on face similarity using faceIds. The output is one or more disjointed face groups and a MessyGroup. A face group contains the faces that have similar looking, often of the same person. There will be one or more face groups ranked by group size, i.e. number of face. Faces belonging to the same person might be split into several groups in the result. The MessyGroup is a special face group that each face is not similar to any other faces in original candidate faces. The messyGroup will not appear in the result if all faces found their similar counterparts. The candidate face list has a limit of 100 faces.
Kind: inner method of face
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faces | Array.<string> |
Array of faceIds to use |
1-to-many identification to find the closest matches of the specific query person face(s) from a person group or large person group. For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the person group (given by personGroupId) or large person group (given by largePersonGroupId), and return candidate person(s) for that face ranked by similarity confidence. The person group/large person group should be trained to make it ready for identification.
Kind: inner method of face
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faces | Array.<string> |
Array of faceIds to use |
options | object |
Identify options |
options.personGroupId | string |
Id of person group from which faces will be identified (personGroupId and largePersonGroupId should not be provided at the same time) |
options.largePersonGroupId | string |
Id of large person group from which faces will be identified (personGroupId and largePersonGroupId should not be provided at the same time) |
options.maxNumOfCandidatesReturned | Number |
Optional max number of candidates per face (default=1, max=5) |
options.confidenceThreshold | Number |
Confidence threshold of identification, used to judge whether one face belong to one person. The range of confidenceThreshold is [0, 1] (default specified by algorithm). |
Analyzes two faces and determine whether they are from the same person. Verification works well for frontal and near-frontal faces. For the scenarios that are sensitive to accuracy please use with own judgment.
Kind: inner method of face
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
faces | Array.<string> | object |
An array containing two faceIds to use, or an object with the fields faceId, personId, and personGroupId |
Kind: static namespace of Client
- .text :
object
Proofs a word or phrase. Offers Microsoft Office Word-like spelling corrections. Longer phrases can be checked, and the result will include casing corrections while avoiding aggressive corrections.
Kind: inner method of text
Returns: Promise
- - A promise in which the resulting JSON is returned.
Param | Type | Description |
---|---|---|
text | string |
Word or phrase to spell check. |
preContextText | string |
Optional context of one or more words preceding the target word/phrase. |
postContextText | string |
Optional context of one or more words following the target word/phrase. |
market | string |
Optional market |
Spell checks a word or phrase. Spell checks offers search-engine-like corrections. Short phrases (up to 9 tokens) will be checked, and the result will be optimized for search queries, both in terms of performance and relevance.
Kind: inner method of text
Returns: Promise
- - A promise in which the resulting JSON is returned.
Param | Type | Description |
---|---|---|
text | string |
Word or phrase to spell check. |
preContextText | string |
Optional context of one or more words preceding the target word/phrase. |
postContextText | string |
Optional context of one or more words following the target word/phrase. |
market | string |
Optional market |
Kind: static namespace of Client
- .vision :
object
- static
- .result
- .get(operation) ⇒
Promise
- .get(operation) ⇒
- .models :
object
- .list() ⇒
Promise
- .analyzeImage(model, options) ⇒
Promise
- .list() ⇒
- .result
- inner
- ~analyzeImage(options) ⇒
Promise
- ~thumbnail(options) ⇒
Promise
- ~ocr(options) ⇒
Promise
- ~recognizeText(options) ⇒
Promise
- ~analyzeImage(options) ⇒
- static
Kind: static property of vision
Checks the result of a text recognition request. When an operation is deemed completed,
the status of the returned object should be 'Succeeded' (or, possibly, 'Failed'.) The
recognitionResult
contains the result when the operation is complete.
Kind: static method of result
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
operation | Object |
Object holding the result URL |
Kind: static namespace of vision
- .models :
object
- .list() ⇒
Promise
- .analyzeImage(model, options) ⇒
Promise
- .list() ⇒
Lists the domain-specific image analysis models.
Kind: static method of models
Returns: Promise
- - Promise resolving with the resulting JSON
Analyze an image using a domain-specific image classifier.
Kind: static method of models
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
model | string |
Name of the model |
options | Object |
Options object location of the source image |
options.url | string |
Url to image to be analyzed |
options.path | string |
Path to image to be analyzed |
This operation does a deep analysis on the given image and then extracts a set of rich visual features based on the image content.
Kind: inner method of vision
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | Object |
Options object describing features to extract |
options.url | string |
Url to image to be analyzed |
options.path | string |
Path to image to be analyzed |
options.data | string |
Buffer of image to be analyzed |
options.ImageType | boolean |
Detects if image is clipart or a line drawing. |
options.Color | boolean |
Determines the accent color, dominant color, if image is black&white. |
options.Faces | boolean |
Detects if faces are present. If present, generate coordinates, gender and age. |
options.Adult | boolean |
Detects if image is pornographic in nature (nudity or sex act). Sexually suggestive content is also detected. |
options.Categories | boolean |
Image categorization; taxonomy defined in documentation. |
options.Tags | boolean |
Tags the image with a detailed list of words related to the image content. |
options.Description | boolean |
Describes the image content with a complete English sentence. |
Generate a thumbnail image to the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart crop coordinates based on the ROI. Smart cropping is designed to help when you specify an aspect ratio that differs from the input image.
Kind: inner method of vision
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | Object |
Options object describing features to extract |
options.url | string |
Url to image to be thumbnailed |
options.path | string |
Path to image to be thumbnailed |
options.data | string |
Buffer of image to be analyzed |
options.width | number |
Width of the thumb in pixels |
options.height | number |
Height of the thumb in pixels |
options.smartCropping | boolean |
Should SmartCropping be enabled? |
options.pipe | Object |
We'll pipe the returned image to this object |
Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream.
Kind: inner method of vision
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | Object |
Options object describing features to extract |
options.url | string |
Url to image to be analyzed |
options.path | string |
Path to image to be analyzed |
options.data | string |
Buffer of image to be analyzed |
options.language | string |
BCP-47 language code of the text to be detected in the image. Default value is "unk", then the service will auto detect the language of the text in the image. |
options.detectOrientation | string |
Detect orientation of text in the image |
Recognize text, including hand-written text.
Kind: inner method of vision
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
options | Object |
Options object describing features to extract |
options.url | string |
Url to image to be analyzed |
options.path | string |
Path to image to be analyzed |
options.data | string |
Buffer of image to be analyzed |
options.handwriting | string |
Whether the image is of hand-written text. Default is false. |
Kind: static namespace of Client
- .weblm :
object
- ~listModels() ⇒
Promise
- ~breakIntoWords(model, text, options) ⇒
Promise
- ~generateWords(model, words, options) ⇒
Promise
- ~getJointProbabilities(model, phrases, order) ⇒
Promise
- ~getConditionalProbabilities(model, queries, order) ⇒
Promise
- ~listModels() ⇒
List available language models for the service currently.
Kind: inner method of weblm
Returns: Promise
- - Promise resolving with the resulting JSON
Breaks text in to consituent words
Kind: inner method of weblm
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
model | string |
Name of model. Currently one of title/anchor/query/body |
text | string |
Text to break. E.g. onetwothree |
options | Object |
Options object |
options.order | Number |
Optional N-gram order. Default is 5 |
options.maxCandidates | Number |
Optional maximum candidate count. Default is 5 |
Generates a list of candidate of words that would follow the a given sequence of one or more words
Kind: inner method of weblm
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
model | string |
Name of model. Currently one of title/anchor/query/body |
words | string |
Text to break. E.g. 'hello world wide' |
options | Object |
Options object |
options.order | Number |
Optional N-gram order. Default is 5 |
options.maxCandidates | Number |
Optional maximum candidate count. Default is 5 |
Generates a list of candidate of words that would follow the a given sequence of one or more words
Kind: inner method of weblm
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
model | string |
Name of model. Currently one of title/anchor/query/body |
phrases | Array.<string> |
One or more phrases for which to look up the probalities of the word sequences |
order | Number |
Optional N-gram order. Default is 5 |
Generates a list of candidate of words that would follow the a given sequence of one or more words
Kind: inner method of weblm
Returns: Promise
- - Promise resolving with the resulting JSON
Param | Type | Description |
---|---|---|
model | string |
Name of model. Currently one of title/anchor/query/body |
queries | Array |
One of more objects consisting of 'words'/'word' pairs, where the conditional probability of 'word' in the context of 'words' is computed. |
order | Number |
Optional N-gram order. Default is 5 |
Licensed as MIT - please see LICENSE for details.