Commit 4b9d9afd by vincent

init nodejs examples

parent 9af582a7
...@@ -2,6 +2,7 @@ node_modules ...@@ -2,6 +2,7 @@ node_modules
.rpt2_cache .rpt2_cache
examples examples
examples-nodejs
proto proto
weights weights
weights_uncompressed weights_uncompressed
......
import * as faceapi from '../src'
import '@tensorflow/tfjs-node'
import * as canvas from 'canvas';
import * as path from 'path';
const { Canvas, Image } = canvas
faceapi.env.monkeyPatch({ Canvas, Image })
async function run() {
await faceapi.nets.ssdMobilenetv1.loadFromDisk(path.resolve(__dirname, '../weights'))
const img = await canvas.loadImage('./bbt1.jpg')
const detections = await faceapi.detectAllFaces(img)
console.log(detections)
}
run()
\ No newline at end of file
{
"author": "justadudewhohacks",
"license": "MIT",
"dependencies": {
"@tensorflow/tfjs-node": "^0.1.19",
"canvas": "^2.0.1"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment