Merge pull request #16 from meeki007/patch-1

Add comments and fix typo
pull/19/head
Vladimir Mandic 2020-12-02 15:27:00 -05:00 committed by GitHub
commit df594133d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ const fs = require('fs');
const path = require('path');
const tf = require('@tensorflow/tfjs-node');
const faceapi = require('../dist/face-api.node.js');
// if you heve module installed, this would be
// if you have module installed, this would be
// const faceapi = require('@vladmandic/face-api');
// configuration options
@ -39,10 +39,10 @@ async function image(img) {
async function main() {
// initialize tfjs
log('FaceAPI Test');
await faceapi.tf.setBackend('tensorflow');
await faceapi.tf.setBackend('tensorflow'); //Sets the backend (cpu, webgl, wasm, tensorflow, etc) responsible for creating tensors and executing operations on those tensors.
await faceapi.tf.enableProdMode();
await faceapi.tf.ENV.set('DEBUG', false);
await faceapi.tf.ready();
await faceapi.tf.ready(); //Returns a promise that resolves when the currently selected backend (or the highest priority one) has initialized.
// check version
log(`Version: TensorFlow/JS ${str(faceapi.tf?.version_core || '(not loaded)')} FaceAPI ${str(faceapi?.version || '(not loaded)')} Backend: ${str(faceapi.tf?.getBackend() || '(not loaded)')}`);