Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

face-plusplus-node

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

face-plusplus-node

Face++ v3 API wrapper for Node.JS

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

face-plusplus-node

[![npm version](https://badge.fury.io/js/face-plusplus-node.svg (https://badge.fury.io/js/face-plusplus-node)

Face++ /v3 faceplusplus.com API wrapper for Node.js

Installation with npm

$ npm install face-plusplus-node

Configuration

    var facepp = require('face-plusplus-node');

Set your API Key / Get your API key and secret at faceplusplus.com (Required)

    facepp.setApiKey('API_KEY');

Set your API Secret(Required)

    facepp.setApiSecret('API_SECRET');

Set the server (For now only options are 'us' or 'cn')(Optional)

    facepp.setServer('cn');

Examples

Face Detection request (pass an image at a URL)

    var facepp = require('face-plusplus-node');

    facepp.setApiKey('API_KEY');
    facepp.setApiSecret('API_SECRET');

    var parameters = {
        image_url: 'http://example.com/image.jpg',
        reutn_attributes: 'gender,age,emotion'
    };
    facepp.post('/detect', parameters, function(err, res) {
        console.log(res);
    });

Face Detection request (pass an image from the local file system using base64 encoding)

    var facepp = require('face-plus-plus'),
        fs = require('fs');

    facepp.setApiKey('API_KEY');
    facepp.setApiSecret('API_SECRET');

    var parameters = {
        return_attributes: 'ethnicity,beauty,eyegaze',
        image_base64: fs.readFileSync('./image.jpg').toString('base64')
        }
    };
    facepp.post('/detect', parameters, function(err, res) {
        console.log(res);
    });

Face Comparison request (pass 2 images from the local file system using base64 encoding)

    var facepp = require('face-plus-plus'),
        fs = require('fs');

    facepp.setApiKey('API_KEY');
    facepp.setApiSecret('API_SECRET');

    var parameters = {
        image_base64_1: fs.readFileSync('./image1.jpg').toString('base64'),
        image_base64_2: fs.readFileSync('./image2.jpg').toString('base64'),
        }
    };
    facepp.post('/compare', parameters, function(err, res) {
        console.log(res);
    });

You can see all possible parameters and ways to pass image and also compare two faces you can see Face++ Documentation

License

MIT

Keywords

FAQs

Package last updated on 26 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc