mashape-animetrics-face-api
v0.0.3
Published
Packge for integrate Masape Animetrics Face Recognition
Downloads
10
Maintainers
Readme
mashape-animetrics-face-api
Packge for integrate Masape Animetrics Face Recognition
Installation
Download
Download the latest release
Clone the repo
$ git clone https://github.com/mdasmendel/mashape-animetrics-face-api.git
Install with npm
$ npm install mashape-animetrics-face-api
Usage
// Basic usage
const mashapeAnimetricsApi = require('mashape-animetrics-face-api');
let client = mashapeAnimetricsApi.client({
"animetricsKey": "xxxxxxxxxxxxxxxxx",
"mashapeKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
});
...
co(function *(){
...
let detect = yield mashapeCilent.detect.fromUrl('photo url here');//detect image from url
let enroll = yield detect.enroll('gallery id here', 'subject id here','face id (default 0)');//enroll image from current detect
let gallery = yield mashapeCilent.gallery('gallery id').getSubjects();//get subjects id
enroll = yield mashapeCilent.gallery('gallery id').enroll('image obj', 'face obj', 'subject id');//enroll image in current group
...
})
.catch(onError)
...
Documentation
Follow this link for access docs
Methods
Client
mashape-animetrics-face-api module
gallery
Get one gallery by id
Parameters
id
String The gallery id
Returns Gallery Instance of EnrollClient class
galleries
Get all client galleries
Returns Array<Gallery> Instance of EnrollClient class
Detect
mashape-animetrics-face-api module
getImage
Get image data
Returns Object The image object
getFaces
Get faces list
Returns Array The list of faces
getFacesCount
Get faces count
Returns Integer The count of faces
hasFaces
Check if the image has faces found
Returns Boolean
getFace
Get face by index
Parameters
index
**Integer?= ** Face index
Returns Object
enroll
Enrol one face from image
Parameters
Returns Enroll
recognize
Recognize image from detect
Parameters
galleryId
String Gallery idindex
Integer Face index
Returns Recognize
DetectClient
mashape-animetrics-face-api module
fromUrl
Get detector from url
Parameters
url
String Image urlselector
String Selectors for find filter, default: FULL, ex: 'FACE, EYES, FULL'
Returns Detect Instance of detect class
Enroll
mashape-animetrics-face-api module
EnrollClient
mashape-animetrics-face-api module
_enroll
Enroll in the group
Parameters
Returns Enroll
Gallery
mashape-animetrics-face-api module
getSubjects
Get subjects from gallery
Returns Array
enroll
Enroll in this gallery
Parameters
Returns Enroll
recognize
Recognize face in this group
Parameters
Returns Recognize
GalleryClient
mashape-animetrics-face-api module
get
Get one subjects from gallery
Parameters
id
String Gallery id
Returns Gallery
list
Get list subjects from gallery
Recognize
mashape-animetrics-face-api module
get
Get candidates list
get
Get top candidates
Returns Object
RecognizeClient
mashape-animetrics-face-api module
execute
Recognize face
Parameters
galleryId
String Gallery Idimage
Object Image object - mast contain image_idface
Object FAce object - mast contain face data
Returns Recognize
Copyright and license
Copyright Dascal Mihai, 2017.
Licensed under the MIT License