diff --git a/Configuration.md b/Configuration.md index 613ed07..a2e604a 100644 --- a/Configuration.md +++ b/Configuration.md @@ -174,8 +174,11 @@ const config: Config = { }, segmentation: { - enabled: false, // if segmentation is enabled, output result.canvas will be augmented - // with masked image containing only person output + enabled: false, // controlls and configures all body segmentation module + // removes background from input containing person + // if segmentation is enabled it will run as preprocessing task before any other model + // alternatively leave it disabled and use it on-demand using human.segmentation method which can + // remove background or replace it with user-provided background modelPath: 'selfie.json', // experimental: object detection model, can be absolute path or relative to modelBasePath // can be 'selfie' or 'meet' }, diff --git a/Usage.md b/Usage.md index bae8601..2c5a48c 100644 --- a/Usage.md +++ b/Usage.md @@ -61,6 +61,7 @@ Example that performs single detection and then draws new interpolated result at human.image(image, config?) // runs image processing without detection and returns canvas human.warmup(config, image? // warms up human library for faster initial execution after loading // if image is not provided, it will generate internal sample + human.models // dynamically maintained list of object of any loaded models human.tf // instance of tfjs used by human ``` @@ -77,11 +78,15 @@ For details, see [embedding documentation](https://github.com/vladmandic/human/w human.enhance(face) // returns enhanced tensor of a previously detected face that can be used for visualizations ``` -Internal list of modules and objects used by current instance of `Human`: +## Input Segmentation and Backgroun Removal or Replacement + +`Human` library can attempt to detect outlines of people in provided input and either remove background from input +or replace it with a user-provided background image ```js - human.models // dynamically maintained list of object of any loaded models - human.classes // dynamically maintained list of classes that perform detection on each model + const inputCanvas = document.getElementById('my-canvas); + const replacementBackground = document.getElementById('my-background); + human.segmentation(inputCanvas, replacementBackground); ``` ## Draw Functions