推荐一款可以在浏览器中运行的人脸识别库

2019-11-27 17:18:18

推荐一款可以在浏览器中运行的人脸识别库

face

介绍一款人脸识别库--face-api.js

地址:https://github.com/justadudewhohacks/face-api.js

描述

在浏览器或者nodejs环境中用tensorflow.js实现的人脸探测和识别的js接口

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js

特点

  • 人脸识别(Face Recognition)
  • 人脸特征检测(Face Landmark Detection)
  • 面部表情检测(Face Expression Recognition)
  • 年龄测定(Age Estimation)
  • 性别检测(Gender Recognition)

demo address

demo 地址⬇️

https://justadudewhohacks.github.io/face-api.js/

食用方法

克隆仓库

git clone https://github.com/justadudewhohacks/face-api.js.git

运行浏览器示例

cd face-api.js/examples/examples-browser
npm i
npm start

打开 http://localhost:3000

运行Nodejs示例

cd face-api.js/examples/examples-nodejsnpm i
  • 利用ts-node运行例子
ts-node faceDetection.ts
  • node编译运行
tsc faceDetection.tsnode faceDetection.js

直接在页面中引用js脚本

拷贝dist目录下的face-api.js到项目中直接引用。

文件链接:https://github.com/justadudewhohacks/face-api.js/tree/master/dist/face-api.js