Dynamically load TensorFlow JS

This commit is contained in:
2021-01-31 05:53:35 +01:00
parent 155dc45906
commit c950b4d28e
4 changed files with 8 additions and 25 deletions

View File

@ -993,6 +993,9 @@ class CallWindow extends CustomEvents {
// Load network if required
if (!this.backgroundDetectionNetwork)
{
await includeJS(ComunicConfig.assetsURL + "3rdparty/tfjs/tfjs-1.2.min.js");
await includeJS(ComunicConfig.assetsURL + "3rdparty/tensorflow-models/body-pix-2.0.js");
this.backgroundDetectionNetwork = await bodyPix.load({
multiplier: 0.75,
stride: 32,