GithubHelp home page GithubHelp logo

hama / faceapp.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luludotdev/faceapp.js

0.0 2.0 0.0 24 KB

JavaScript API wrapper for the FaceApp tool for Android and iOS

License: ISC License

JavaScript 100.00%

faceapp.js's Introduction

FaceApp

NPM version NPM downloads Build status Dependencies

JavaScript API wrapper for the FaceApp tool for Android and iOS. Licensed under ISC License.

NOTE: Node.js 8 or higher is REQUIRED

Installation

Using NPM: npm install faceapp
Using Yarn: yarn add faceapp

Usage

First, import the module

const faceapp = require('faceapp')

The function takes two parameters:

  • path: string | file: Buffer - Path to the image file you would like to process. Or a Buffer object representing an image.
  • filterID: string - FaceApp Filter ID

Example

// Import the module
const faceapp = require('faceapp')

// Process the image (filepath)
let image = await faceapp.process('path/to/image.png', 'smile_2')

// Process the image (buffer)
// First we have to get a buffer
let res = await superagent.get('http://example.com/image.png')
let image = await faceapp.process(res.body, 'hot')

Filter IDs

There are some known Filter IDs:

  • no-filter
  • smile
  • smile_2
  • hot
  • old
  • young
  • female_2
  • female
  • male
  • pan
  • hitman

However, you can get an up-to-date list of all available filter IDs from the API directly using the listFilters function.

let filters = await faceapp.listFilters()
// Returns an array of Filter objects

let filters = await faceapp.listFilters(true)
// Returns an array filter ID strings

Thanks

faceapp.js's People

Contributors

luludotdev avatar

Watchers

fang qiang avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.