• This repository has been archived on 24/Jun/2019
  • Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”­ Project Oxford for Node

Project Oxford for Node.js

npm version

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.

Usage

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.

Client

Kind: global class

new Client(key, hostOrRegion)

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

Client.emotion : object

Kind: static namespace of Client

emotion~analyzeEmotion(options) β‡’ Promise

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.

Client.face : object

Kind: static namespace of Client

face.faceList : object

Kind: static namespace of face

faceList.list() β‡’ Promise

Lists the faceListIds, and associated names and/or userData.

Kind: static method of faceList
Returns: Promise - - Promise resolving with the resulting JSON

faceList.create(faceListId, options) β‡’ Promise

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.

faceList.update(faceListId, options) β‡’ Promise

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.

faceList.delete(faceListId) β‡’ Promise

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

faceList.get(faceListId) β‡’ Promise

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

faceList.addFace(faceListId, options) β‡’ Promise

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".

faceList.deleteFace(faceListId, persistedFaceId) β‡’ Promise

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

face.personGroup : object

Kind: static namespace of face

personGroup.create(personGroupId, name, userData) β‡’ Promise

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.

personGroup.delete(personGroupId) β‡’ Promise

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

personGroup.get(personGroupId) β‡’ Promise

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

personGroup.trainingStatus(personGroupId) β‡’ Promise

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

personGroup.trainingStart(personGroupId) β‡’ Promise

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

personGroup.update(personGroupId, name, userData) β‡’ Promise

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.

personGroup.list(options) β‡’ Promise

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.

face.person : object

Kind: static namespace of face

person.addFace(personGroupId, personId, options) β‡’ Promise

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.

person.deleteFace(personGroupId, personId, persistedFaceId) β‡’ Promise

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.

person.updateFace(personGroupId, personId, persistedFaceId, userData) β‡’ Promise

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.

person.getFace(personGroupId, personId, persistedFaceId) β‡’ Promise

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.

person.create(personGroupId, name, userData) β‡’ Promise

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.

person.delete(personGroupId, personId) β‡’ Promise

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.

person.get(personGroupId, personId) β‡’ Promise

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.

person.update(personGroupId, personId, name, userData) β‡’ Promise

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.

person.list(personGroupId) β‡’ Promise

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)

face.largePersonGroup : object

Kind: static namespace of face

largePersonGroup.create(largePersonGroupId, name, userData) β‡’ Promise

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.

largePersonGroup.delete(largePersonGroupId) β‡’ Promise

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

largePersonGroup.get(largePersonGroupId) β‡’ Promise

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

largePersonGroup.trainingStatus(largePersonGroupId) β‡’ Promise

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

largePersonGroup.trainingStart(largePersonGroupId) β‡’ Promise

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

largePersonGroup.update(largePersonGroupId, name, userData) β‡’ Promise

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.

largePersonGroup.list(options) β‡’ Promise

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.

face.largePersonGroupPerson : object

Kind: static namespace of face

largePersonGroupPerson.addFace(largePersonGroupId, personId, options) β‡’ Promise

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.

largePersonGroupPerson.deleteFace(largePersonGroupId, personId, persistedFaceId) β‡’ Promise

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.

largePersonGroupPerson.getFace(largePersonGroupId, personId, persistedFaceId) β‡’ Promise

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.

largePersonGroupPerson.create(largePersonGroupId, name, userData) β‡’ Promise

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.

largePersonGroupPerson.delete(largePersonGroupId, personId) β‡’ Promise

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.

largePersonGroupPerson.get(largePersonGroupId, personId) β‡’ Promise

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.

largePersonGroupPerson.update(largePersonGroupId, personId, name, userData) β‡’ Promise

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.

largePersonGroupPerson.list(largePersonGroupId) β‡’ Promise

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)

face~detect(options) β‡’ Promise

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?

face~similar(sourceFace, options) β‡’ Promise

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")

face~grouping(faces) β‡’ Promise

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

face~identify(faces, options) β‡’ Promise

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).

face~verify(faces) β‡’ Promise

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

Client.text : object

Kind: static namespace of Client

text~proof(text, preContextText, postContextText, market) β‡’ Promise

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

text~spellCheck(text, preContextText, postContextText, market) β‡’ Promise

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

Client.vision : object

Kind: static namespace of Client

vision.result

Kind: static property of vision

result.get(operation) β‡’ Promise

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

vision.models : object

Kind: static namespace of vision

models.list() β‡’ Promise

Lists the domain-specific image analysis models.

Kind: static method of models
Returns: Promise - - Promise resolving with the resulting JSON

models.analyzeImage(model, options) β‡’ Promise

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

vision~analyzeImage(options) β‡’ Promise

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.

vision~thumbnail(options) β‡’ Promise

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

vision~ocr(options) β‡’ Promise

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

vision~recognizeText(options) β‡’ Promise

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.

Client.weblm : object

Kind: static namespace of Client

weblm~listModels() β‡’ Promise

List available language models for the service currently.

Kind: inner method of weblm
Returns: Promise - - Promise resolving with the resulting JSON

weblm~breakIntoWords(model, text, options) β‡’ Promise

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

weblm~generateWords(model, words, options) β‡’ Promise

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

weblm~getJointProbabilities(model, phrases, order) β‡’ Promise

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

weblm~getConditionalProbabilities(model, queries, order) β‡’ Promise

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

License

Licensed as MIT - please see LICENSE for details.

More Repositories

1

windows95

πŸ’©πŸš€ Windows 95 in Electron. Runs on macOS, Linux, and Windows.
TypeScript
22,225
star
2

macintosh.js

πŸ–₯ A virtual Apple Macintosh with System 8, running in Electron. I'm sorry.
JavaScript
8,280
star
3

windows-build-tools

πŸ“¦ Install C++ Build Tools for Windows using npm
TypeScript
3,398
star
4

npm-windows-upgrade

πŸš€ Upgrade npm on Windows
JavaScript
2,539
star
5

windows-development-environment

πŸ”­ Turning Windows into an environment ready for modern development
PowerShell
1,359
star
6

React-Dropzone-Component

πŸ“· ReactJS Dropzone for File Uploads (using Dropzone.js)
JavaScript
1,001
star
7

React-Spreadsheet-Component

πŸ“‹ Spreadsheet Component for ReactJS
JavaScript
763
star
8

electron-windows-notifications

⚑ Send native Windows WinRT notifications from Electron
JavaScript
262
star
9

slack-archive

Generate static HTML archives of Slack workspaces
TypeScript
239
star
10

electron-code-editor

⚑ A tiny code editor based on Electron, in ~100 lines of code
JavaScript
159
star
11

electron-notification-state

πŸ” Should you display a notification? Let's find out!
TypeScript
149
star
12

Ghost-Azure

πŸ‘» Install Ghost on Azure with a simple click
JavaScript
129
star
13

peer-review-bot

A little bot checking GitHub pull requests for peer reviews
JavaScript
102
star
14

vsc-ember-cli

⚑ Turn Visual Studio Code into an Ember Cli IDE
TypeScript
92
star
15

razer-chroma

πŸ”₯ Control your Razer Keyboard, right from Node
C++
90
star
16

electron-uwp-background

⚑ Sample explaining how to use UWP background tasks with Electron apps
C#
82
star
17

Node-Mayhem

πŸ’£ Multiplayer HTML5 shooter with Node.js, Socket.io and Melon.js
JavaScript
69
star
18

Ghost-Updater-Azure

πŸ‘» Update Ghost on Azure Websites / Azure Web Apps with a few clicks
JavaScript
62
star
19

electron-windows-interactive-notifications

⚑ Respond to interactive notifications on Windows, from Electron
C++
57
star
20

responsive-images-generator

Generate responsive images from Node
JavaScript
55
star
21

dennard

πŸ”¬ Tiny Node cli tool to see a local app's memory footprint, cross-platform
JavaScript
54
star
22

macos-notification-state

πŸ” This native module checks if the user is active, if the screen is locked, or if "do not disturb" is enabled.
Objective-C++
53
star
23

travis-jekyll-git

Deploy Jekyll pages using Git and Travis CI
Shell
44
star
24

Reveal-PikeStreet

"Pike Street" Theme for Reveal.js, intended for Microsoft's DX's Open Source Engineers
JavaScript
44
star
25

monaco-loader

πŸ“¦ Load the Monaco editor with a module loader (require, import, etc)
JavaScript
36
star
26

introducing-electron-editor

Code used in the book "Introducing Electron"
JavaScript
36
star
27

JARVIS

Node.js Personal Assistant Prototype
JavaScript
30
star
28

windows-quiet-hours

Checks if Windows 10 quiet hours are active
JavaScript
26
star
29

parse-server-azure

Adapters, tools, and documentation to use Parse-Server with Microsoft Azure
JavaScript
23
star
30

onedrive-link

Generate direct download links for OneDrive
JavaScript
23
star
31

vsc-travis-ci-status

:shipit: Check the status of your Travis CI project from Visual Studio Code
TypeScript
23
star
32

parse-docker

🚀 Run the Open Source Parse Server in Docker
JavaScript
22
star
33

electron-windows-sample

⚑ A minimal Electron sample application showing how to make an Electron app look native on Windows
JavaScript
20
star
34

ember-cli-azure-deploy

πŸ”§ Build Ember Cli Apps on Azure Websites
Shell
19
star
35

electron-comrade

πŸ”§ Run Electron apps with different versions or builds of Electron
TypeScript
18
star
36

parse-server-azure-storage

Use Azure Blob Storage with Parse Server
JavaScript
16
star
37

windows-shortcuts-ps

Node.js: Read Windows shortcuts without native dependencies (Windows 7 and up)
JavaScript
15
star
38

parse-docker-azure

🐳 Deploy the Open Source Parse Server on Azure, using Docker
15
star
39

iojs-azure

Running io.js on Azure Websites
Shell
15
star
40

emoji-autocomplete

πŸ“‡ Node Library, turning words into emojis (turn rent into 🏠 πŸ’Έ)
JavaScript
14
star
41

windows-active-process

Check which process is currently in the foreground (focused / active)
C++
14
star
42

electron-winstore-auto-launch

πŸš€ Configure your Electron to start automatically when the user logs in
TypeScript
14
star
43

ember-cli-windows-addon

🚀 Ember Addon, Optimizing Ember Cli Performance on Windows
JavaScript
14
star
44

WinBridge

Native WinRT Controls & Features for Unity3D
C#
14
star
45

MicrosoftBand-Sample

A small sample showcasing interaction with the Microsoft Band
C#
13
star
46

sleuth

πŸ•΅οΈβ€β™‚οΈ A Slack log viewer
TypeScript
12
star
47

windows-notification-state

SHQueryUserNotificationState, but as a native Node addon
JavaScript
11
star
48

SlackbotBender

A simple chatbot for slack.
JavaScript
10
star
49

medium-stats

You want Medium stats for traffic sources, this tool will give them to you
JavaScript
10
star
50

electron-smorgasbord

πŸ“¦ A local update server for Squirrel & Electron, with a fancy GUI
TypeScript
10
star
51

lets-encrypt-iis

IIS Configurator for the wonderful Let's Encrypt project
Python
10
star
52

electron-face-detection-windows

Detect Faces in images, using Windows' very own face detection
JavaScript
9
star
53

chrome-cachetool

Chrome & Chromium's "cachetool"
TypeScript
9
star
54

Ghost-Desktop

Ghost for Desktops
JavaScript
7
star
55

azure-node4

Run Node.js 4.0 on Azure
Shell
7
star
56

modernweb

Code Demo for ModernWeb 2018 Keynote
HTML
6
star
57

javascript-course

Solutions to my little JavaScript course's exercises
JavaScript
6
star
58

electron-versions

Get Electron and Chromium versions for tags in a given repository
TypeScript
6
star
59

node-app-nap

😴 Disable macOS App Nap using Node
Objective-C++
5
star
60

electron-test-build

Take a built Electron app, replace the version of Electron
JavaScript
4
star
61

azure-npm3

Use npm3 on Azure Web Apps (formerly known as Azure Websites)
Shell
4
star
62

docker-jekyll

🐳 Jekyll with Extras for Docker
4
star
63

electron-forge-maker-nsis

An electron-forge maker for NSIS that supports electron-forge v6 and can be used as a replacement for electron-builder. Supports code-signing and basic updates with electron-updater.
TypeScript
4
star
64

electron-squirrel-s3

Update your Electron app directly from S3
TypeScript
4
star
65

UnityGettingStarted

Code for the TR Unity Presentation
C#
4
star
66

nodesummit-workshop

JavaScript
4
star
67

waffle

JavaScript
4
star
68

windows-process-info

In Node.js, quickly check if a process is running on win32. Fast, small, native.
JavaScript
4
star
69

shout-azure

πŸ”ˆ Deploy Shout to Azure
3
star
70

AndroidAzureTweets

A sample Twitter-Style app using Azure Mobile Services for Android
Java
3
star
71

mountaingiantweb

JavaScript
3
star
72

find-npm-windows

πŸ“¦ Find npm on Windows
JavaScript
3
star
73

dengue-research-portal

πŸ’» A researcher's portal into dengue fever history and machine learning prediction
JavaScript
3
star
74

internet-explorer-version

Find the installed version of Internet Explorer, using Node.js
JavaScript
3
star
75

wrapped

A silly "wrapped" generator for my team
TypeScript
3
star
76

chrome-software-rendering-list

πŸ™… Chromium's list of blacklisted GPUs, consumable as a Node module
JavaScript
2
star
77

Unity-WinRT-WP8-PlayMovieNatively

Playing a movie on WinRT from within Unity
C#
2
star
78

atom-ghost

Write your blog posts in Atom, publish with Ghost
JavaScript
2
star
79

slack-wechat-bridge

TypeScript
2
star
80

SmoothRawMouse-UnityWindows8

Smoothened Mouse device delta readings in Unity for Windows 8 Store
C#
2
star
81

DJWindows98

A Mini Stage Show for DJ Windows 98
C#
2
star
82

node12-azure

Run Node 0.12 (Stable) on Azure Websites
Shell
2
star
83

adfreeclient

Client for AdFree, TechCrunch Disrupt Hackathon Project
CSS
2
star
84

LockLogger

A little debugging tool to log your session status
JavaScript
2
star
85

ember-visual-studio

A Visual Studio extension for Ember and Ember Cli
C#
1
star
86

ghost-arm

Ghost for ARM
JavaScript
1
star
87

sailsjs-azure

SailsJS, deployable to Azure
JavaScript
1
star
88

test-windows-linux-subsystem

⚑ We should probably test this Linux thing we just got
Shell
1
star
89

buy-my-vanagon

https://www.1979vanagon.com
HTML
1
star
90

SquirrelCLSIDForAppUserModelId

Quickly see what ToastActivatorCLSID Squirrel would generate for your AppUserModelId
C#
1
star
91

electron-drone

JavaScript
1
star
92

sanitize-xml-string

Sanitize a string for use with XML
TypeScript
1
star
93

npm-config-arguments

Parses npm_config env variables and assigns them to argv - useful for 'npm run' commands
JavaScript
1
star
94

kona

πŸƒ Kona A Slack Bot for Strava
TypeScript
1
star
95

tile

C++
1
star
96

electron-slack-tutorial

TypeScript
1
star
97

OxideFleet

Oxide, but for Car Management
JavaScript
1
star
98

runtime-logo

A logo for Slack's Desktop Runtime team
JavaScript
1
star
99

electron-react-playground

TypeScript
1
star
100

ember-service-worker-ghost-cache

JavaScript
1
star