Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function createBlurEffect() {
if (!MediaStreamTrack.prototype.getSettings && !MediaStreamTrack.prototype.getConstraints) {
throw new Error('JitsiStreamBlurEffect not supported!');
}
// An output stride of 16 and a multiplier of 0.5 are used for improved
// performance on a larger range of CPUs.
const bpModel = await bodyPix.load({
architecture: 'MobileNetV1',
outputStride: 16,
multiplier: 0.50,
quantBytes: 2
});
return new JitsiStreamBlurEffect(bpModel);
}
async function loadBodyPix() {
toggleLoadingUI(true);
state.net = await bodyPix.load({
architecture: guiState.input.architecture,
outputStride: guiState.input.outputStride,
multiplier: guiState.input.multiplier,
quantBytes: guiState.input.quantBytes
});
toggleLoadingUI(false);
}
async loadModel() {
this.model = await bp.load(this.config.multiplier);
this.modelReady = true;
return this;
}