|
@@ -9,8 +9,7 @@ import JitsiStreamBackgroundEffect from './JitsiStreamBackgroundEffect';
|
9
|
9
|
import createTFLiteModule from './vendor/tflite/tflite';
|
10
|
10
|
import createTFLiteSIMDModule from './vendor/tflite/tflite-simd';
|
11
|
11
|
const models = {
|
12
|
|
- model96: 'libs/segm_lite_v681.tflite',
|
13
|
|
- model144: 'libs/segm_full_v679.tflite'
|
|
12
|
+ modelLandscape: 'libs/selfie_segmentation_landscape.tflite'
|
14
|
13
|
};
|
15
|
14
|
|
16
|
15
|
let tflite;
|
|
@@ -18,11 +17,7 @@ let wasmCheck;
|
18
|
17
|
let isWasmDisabled = false;
|
19
|
18
|
|
20
|
19
|
const segmentationDimensions = {
|
21
|
|
- model96: {
|
22
|
|
- height: 96,
|
23
|
|
- width: 160
|
24
|
|
- },
|
25
|
|
- model144: {
|
|
20
|
+ modelLandscape: {
|
26
|
21
|
height: 144,
|
27
|
22
|
width: 256
|
28
|
23
|
}
|
|
@@ -83,7 +78,7 @@ export async function createVirtualBackgroundEffect(virtualBackground: Object, d
|
83
|
78
|
}
|
84
|
79
|
|
85
|
80
|
const modelBufferOffset = tflite._getModelBufferMemoryOffset();
|
86
|
|
- const modelResponse = await fetch(wasmCheck.feature.simd ? models.model144 : models.model96);
|
|
81
|
+ const modelResponse = await fetch(models.modelLandscape);
|
87
|
82
|
|
88
|
83
|
if (!modelResponse.ok) {
|
89
|
84
|
throw new Error('Failed to download tflite model!');
|
|
@@ -96,7 +91,7 @@ export async function createVirtualBackgroundEffect(virtualBackground: Object, d
|
96
|
91
|
tflite._loadModel(model.byteLength);
|
97
|
92
|
|
98
|
93
|
const options = {
|
99
|
|
- ...wasmCheck.feature.simd ? segmentationDimensions.model144 : segmentationDimensions.model96,
|
|
94
|
+ ...segmentationDimensions.modelLandscape,
|
100
|
95
|
virtualBackground
|
101
|
96
|
};
|
102
|
97
|
|