mirror of https://github.com/vladmandic/human
update readme
parent
4dd24901bd
commit
e0d7e553d6
|
@ -111,7 +111,7 @@ draw output on screen using internal draw helper functions
|
||||||
import Human from '@vladmandic/human';
|
import Human from '@vladmandic/human';
|
||||||
|
|
||||||
// create instance of human with simple configuration using default values
|
// create instance of human with simple configuration using default values
|
||||||
const config = { backend: 'wasm' };
|
const config = { backend: 'webgl' };
|
||||||
const human = new Human(config);
|
const human = new Human(config);
|
||||||
|
|
||||||
function detectVideo() {
|
function detectVideo() {
|
||||||
|
@ -120,8 +120,9 @@ function detectVideo() {
|
||||||
const outputCanvas = document.getElementById('canvas-id');
|
const outputCanvas = document.getElementById('canvas-id');
|
||||||
// perform processing using default configuration
|
// perform processing using default configuration
|
||||||
human.detect(inputVideo).then((result) => {
|
human.detect(inputVideo).then((result) => {
|
||||||
// result object will contain detected details as well as the processed canvas itself
|
// result object will contain detected details
|
||||||
// first draw processed frame on canvas
|
// as well as the processed canvas itself
|
||||||
|
// so lets first draw processed frame on canvas
|
||||||
human.draw.canvas(result.canvas, outputCanvas);
|
human.draw.canvas(result.canvas, outputCanvas);
|
||||||
// then draw results on the same canvas
|
// then draw results on the same canvas
|
||||||
human.draw.face(outputCanvas, result.face);
|
human.draw.face(outputCanvas, result.face);
|
||||||
|
|
Loading…
Reference in New Issue