update usage

master
Vladimir Mandic 2021-03-05 14:42:07 -05:00
parent b3ef9397a0
commit ce4f3e12bd
1 changed files with 5 additions and 4 deletions

@ -82,7 +82,7 @@ draw output on screen using internal draw helper functions
import Human from '@vladmandic/human';
// create instance of human with simple configuration using default values
const config = { backend: 'wasm' };
const config = { backend: 'webgl' };
const human = new Human(config);
function detectVideo() {
@ -91,8 +91,9 @@ function detectVideo() {
const outputCanvas = document.getElementById('canvas-id');
// perform processing using default configuration
human.detect(inputVideo).then((result) => {
// result object will contain detected details as well as the processed canvas itself
// first draw processed frame on canvas
// result object will contain detected details
// as well as the processed canvas itself
// so lets first draw processed frame on canvas
human.draw.canvas(result.canvas, outputCanvas);
// then draw results on the same canvas
human.draw.face(outputCanvas, result.face);
@ -128,4 +129,4 @@ For example:
image.dispose();
```
<hr>
<br><hr>