@vonage/ml-transformers 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/assets/highlight.css +22 -15
- package/dist/docs/enums/BlurRadius.html +7 -1
- package/dist/docs/modules.html +9 -4
- package/dist/ml-transformers.es.js +1 -1
- package/dist/ml-transformers.umd.js +29 -29
- package/dist/types/src/transformers/BackgroundTransformer.d.ts +3 -1
- package/dist/types/src/transformers/BlurPostProcess.d.ts +3 -1
- package/dist/types/src/transformers/SilueteBlurPostProcess.d.ts +3 -1
- package/dist/types/src/types.d.ts +12 -1
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ import { BackgroundOptions } from '../../main';
|
|
|
4
4
|
import { PostProcessInterface } from './PostProcessInterface';
|
|
5
5
|
export declare type ProcessFrame = (image: ImageBitmap) => (void);
|
|
6
6
|
declare class BackgroundTransformer {
|
|
7
|
-
static
|
|
7
|
+
static BLUR_PROCESS_GAP_MICRO_SECOND_LOW: number;
|
|
8
|
+
static BLUR_PROCESS_GAP_MICRO_SECOND_HIGH: number;
|
|
9
|
+
static VIDEO_PROCESS_GAP_MICRO_SECOND: number;
|
|
8
10
|
static VIRTUAL_PROCESS_GAP_MICRO_SECOND: number;
|
|
9
11
|
static NEW_INPUT_NUMBER_OF_RUNS: number;
|
|
10
12
|
static SELFIE_WIDTH: number;
|
|
@@ -4,7 +4,9 @@ import { PostProcessInterface } from "./PostProcessInterface";
|
|
|
4
4
|
import { BlurRadius } from "../types";
|
|
5
5
|
declare class BlurPostProcess implements PostProcessInterface {
|
|
6
6
|
blurFilter_: string;
|
|
7
|
-
|
|
7
|
+
blur_: number;
|
|
8
|
+
constructor(radius?: BlurRadius | number);
|
|
9
|
+
isHighBlur(): boolean;
|
|
8
10
|
destroy(): Promise<void>;
|
|
9
11
|
runPostProcessing(resultCtx: OffscreenCanvasRenderingContext2D | null, image: ImageBitmap): void;
|
|
10
12
|
}
|
|
@@ -4,7 +4,9 @@ import { PostProcessInterface } from './PostProcessInterface';
|
|
|
4
4
|
import { BlurRadius } from '../types';
|
|
5
5
|
declare class SilueteBlurPostProcess implements PostProcessInterface {
|
|
6
6
|
blurFilter_: string;
|
|
7
|
-
|
|
7
|
+
blur_: number;
|
|
8
|
+
constructor(radius?: BlurRadius | number);
|
|
9
|
+
isHighBlur(): boolean;
|
|
8
10
|
destroy(): Promise<void>;
|
|
9
11
|
runPostProcessing(resultCtx: OffscreenCanvasRenderingContext2D | null, image: ImageBitmap): void;
|
|
10
12
|
}
|
|
@@ -11,6 +11,8 @@ import { Results as PoseResults, Options as PoseOptions } from '@mediapipe/pose'
|
|
|
11
11
|
export declare type VonageTransformerType = 'BackgroundBlur' | 'VirtualBackground' | 'VideoBackground' | 'SilueteBlur';
|
|
12
12
|
/**
|
|
13
13
|
* BlurRadius specifies how much bluring filter to apply by a given transformer.
|
|
14
|
+
* @Low - 5px blur
|
|
15
|
+
* @High - 15px blur
|
|
14
16
|
*/
|
|
15
17
|
export declare enum BlurRadius {
|
|
16
18
|
/**
|
|
@@ -52,10 +54,19 @@ export declare type MediaProcessorBaseConfig = {
|
|
|
52
54
|
};
|
|
53
55
|
/**
|
|
54
56
|
* BackgroundBlurConfig specifies the configuration for a transformer logic that performs background blurring.
|
|
57
|
+
* @radius - @BlurRadius or number indicating the blur radius.
|
|
58
|
+
* ```ts
|
|
59
|
+
* let blurConfig: BackgroundBlurConfig = {
|
|
60
|
+
* transformerType: 'BackgroundBlur',
|
|
61
|
+
* radius: 8
|
|
62
|
+
* }
|
|
63
|
+
* // ..
|
|
64
|
+
* ctx.filter = 'blur(8px)'
|
|
65
|
+
* ```
|
|
55
66
|
*/
|
|
56
67
|
export declare type BackgroundBlurConfig = {
|
|
57
68
|
transformerType: 'BackgroundBlur';
|
|
58
|
-
radius?: BlurRadius;
|
|
69
|
+
radius?: BlurRadius | number;
|
|
59
70
|
};
|
|
60
71
|
/**
|
|
61
72
|
* AssetBackgroundConfig specifies the absolute URL to the image or video file used for background replacement.
|