New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

facereplace

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facereplace

Use face recognition to replace faces in pictures

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

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

facereplace

Use face recognition API to replace faces in pictures with a face of your choice using NodeJS.

Install

npm install --save facereplace

CLI/Quickstart

facereplace contains a CLI utility you can use to replace faces in pictures without writing your own script/code.

$ npm install -g facereplace
$ facereplace -f /path/to/facePic.jpeg -p /path/to/destinationPicToReplaceFaces.jpeg
Successfully replaced faces and saved your file here: /Users/yourname/facereplace_1577203511111.jpeg

$ facereplace -f https://acme.com/facePic.jpeg -p https://acme.com/destinationPicToReplaceFaces.png
Successfully replaced faces and saved your file here: /Users/yourname/facereplace_1577203511111.png

API

See Usage for more details

const facePic = '/tmp/facePic.jpeg' // or 'https://acme.com/facePic.jpeg'
const face = FaceReplace(facePic)
  1. face.replace(string) => Promise<Buffer>: takes a string of the local file path or public URL of the picture we want to replace faces in, and replaces them
  2. face.setFacePicture(string) => void: takes a string of the local file path or public URL to replace the picture you want to replace all faces in your target picture(s)

Usage

import fs from 'fs'
import FaceReplace from 'facereplace'
// or
// const FaceReplace = require('facereplace').default

// images on file system
const face = FaceReplace('/tmp/catFace.png')
const imgBuffer = await face.replace('/tmp/picToReplaceFacesWithCatFace.jpeg')
await fs.promises.writeFile('/tmp/replaced.jpeg', imgBuffer)

// images on the internet
const face = FaceReplace()
face.setFacePicture('https://acme.com/face.jpeg') // resets face img, same as passing in first arg to `FaceReplace(firstArg)`
const imgBuffer = await face.replace('https://acme.com/picFullOfFaces.png')

FAQs

Package last updated on 24 Aug 2021

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