npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

seeta

v0.2.4

Published

Node.js wrap for SeetaFaceEngine

Downloads

14

Readme

seeta logonode-seeta

NPM version npm download MIT License

Node.js wrap for SeetaFaceEngine.

see other language version:

Examples

See examples for more implementations.

How to install

System require

| | Ubuntu | Windows | |:------------:|:-----------:|:----------:| | version | 16.04/18.04 | 7/8/8.1/10 | | arch | x64 | x86/x86_64 | | minimum | 1 GB | 1 GB | | recommend | 2+GB | 2+GB | | build status | build status | build status |

Download

  • Git tree: https://github.com/Mitscherlich/node-seeta.git
    • Clone with git clone https://github.com/Mitscherlich/node-seeta.git :hammer: Build instructions.

Usage

Face detection

Detect face(s) in a image.

const FaceDetection = require('seeta').FaceDetection
const path = require('path')
// 1. name face detection model path.
const fdModel = path.join('path', 'to', 'models/SeetaFaceDetector2.0.ats')
// 2. create a detector
const detector = new FaceDetection(fdModel)
// 3. detect face(s) in a image
const results = detector.detect(path.join('path', 'to', 'image/test.png'))
console.log({ result })
// result will in this form:
// {
//   "count": Number,     // count of face(s)
//   "data": {
//     "faces": [{
//       "x": Number,     // face left-upper point x
//       "y": Number,     // face left-upper point y
//       "width": Number, // face bounding box width
//       "height": Number // face bounding box height
//     }]
//   }
// }

Facial points detection

Mark facial points for compare and recognize.

const { FaceDetection, PointDetector } = require('seeta')
const path = require('path')
// 1. name detector models path.
const fdModel = path.join('path', 'to', 'models/SeetaFaceDetector2.0.ats')
const faModel = path.join('path', 'to', 'models/SeetaPointDetector2.0.pts5.ats')
// 2. create a point detector
const detector = new FaceDetection(fdModel)
const pointer = new PointDetector(faModel)
// 3. detect face(s) in a image
const faces = detector.detect(path.join('path', 'to', 'image/test.png'))
if (faces.data && face.data.faces.length) {
  const points = pointer.detect(path.join('path', 'to', 'image/test.png', faces.data.faces[0]))
  console.log({ result })
}
// result will in this form:
// {
//   "data": {
//     "points": [{
//       "x": Number,     // facial point x
//       "y": Number,     // facial point y
//     }]
//   }
// }

Face recognize

  1. 1 vs 1 compare

compare two image contains face and compare for its similar.

const { FaceDetector, PointDetector, FaceRecognizer } = require('seeta')
const path = require('path')
// 1. name detector models path.
const fdModel = path.join('path', 'to', 'models/SeetaFaceDetector2.0.ats')
const faModel = path.join('path', 'to', 'models/SeetaPointDetector2.0.pts5.ats')
const frModel = path.join('path', 'to', 'models/SeetaFaceRecognizer2.0.ats')
// 2. create detectors
console.time('initailize')
const detector = new FaceDetector(fdModel)
const pointer = new PointDetector(faModel)
const recognizer = new FaceRecognizer(frModel)
console.timeEnd('initailize')
// 3. detect face(s) in a image
const imagePath = join('path', 'to', 'data/test.png')

const faces = detector.detect(imagePath)
const face1 = faces.data.faces[0]
const face2 = faces.data.faces[1]

const points1 = pointer.detect(imagePath, face1).data.points
const points2 = pointer.detect(imagePath, face2).data.points
// 4. compare face(s) in two images
const similar = recognizer.compare(
  { path: imagePath, points: points1 }, { path: imagePath, points: points1 }
)
console.log({ similar })
  1. 1 vs n compare
  • first: register a image
const { FaceDetector, PointDetector, FaceRecognizer } = require('seeta')
const path = require('path')
// 1. name detector models path.
const fdModel = path.join('path', 'to', 'models/SeetaFaceDetector2.0.ats')
const faModel = path.join('path', 'to', 'models/SeetaPointDetector2.0.pts5.ats')
const frModel = path.join('path', 'to', 'models/SeetaFaceRecognizer2.0.ats')
// 2. create detectors
console.time('initailize')
const detector = new FaceDetector(fdModel)
const pointer = new PointDetector(faModel)
const recognizer = new FaceRecognizer(frModel)
console.timeEnd('initailize')
// 3. detect face(s) in a image
const imagePath = path.join('path', 'to', 'data/test.png')

const faces = detector.detect(imagePath)
const face = faces.data.faces[0]

const points = pointer.detect(imagePath, face1).data.points
// 4. register a face
const index = recognizer.register(imagePath, points)
console.log({ index }) // ==> the index in recognizer face database
  • find all similar in database
// 5. detect face(s) in a image
const newImage = path.join('path', 'to', 'data/another_image.png')
const faces1 = detector.detect(newImage)
const face1 = faces1.data.faces[0]

const points1 = pointer.detect(newImage, face1).data.points
// 6. find all similar in database
const results = recognizer.recognition(newImage, face1)
if (result.data && result.data.length) {
  console.log({ similars: result.data }) // ==> all similars in face databse
}

License

MIT