@@ -67,7 +67,7 @@ export default function BodyPix() {
67
67
await loadBodyPix ( ) ;
68
68
await loadVideo ( guiState . camera ) ;
69
69
70
- let cameras = await getVideoInputs ( ) ;
70
+ // let cameras = await getVideoInputs();
71
71
72
72
// setupFPS();
73
73
// setupGui(cameras);
@@ -185,51 +185,13 @@ export default function BodyPix() {
185
185
if ( ! canvas . current ) return
186
186
if ( ! videoElement . current ) return
187
187
switch ( guiState . estimate ) {
188
- case "segmentation" :
189
- const multiPersonSegmentation = await estimateSegmentation ( ) ;
190
- switch ( guiState . segmentation . effect ) {
191
- case "mask" :
192
- const ctx = canvas . current . getContext ( "2d" ) ;
193
- const foregroundColor = { r : 255 , g : 255 , b : 255 , a : 255 } ;
194
- const backgroundColor = { r : 0 , g : 0 , b : 0 , a : 255 } ;
195
- const mask = bodyPix . toMask (
196
- multiPersonSegmentation ,
197
- foregroundColor ,
198
- backgroundColor ,
199
- true
200
- ) ;
201
-
202
- bodyPix . drawMask (
203
- canvas . current ,
204
- videoElement . current ,
205
- mask ,
206
- guiState . segmentation . opacity ,
207
- guiState . segmentation . maskBlurAmount ,
208
- flipHorizontally
209
- ) ;
210
- drawPoses ( multiPersonSegmentation , flipHorizontally , ctx ) ;
211
- break ;
212
- case "bokeh" :
213
- bodyPix . drawBokehEffect (
214
- canvas . current ,
215
- videoElement . current ,
216
- multiPersonSegmentation ,
217
- guiState . segmentation . backgroundBlurAmount ,
218
- guiState . segmentation . edgeBlurAmount ,
219
- flipHorizontally
220
- ) ;
221
- break ;
222
- }
223
-
224
- break ;
225
188
case "partmap" :
226
189
const ctx = canvas . current . getContext ( "2d" ) ;
227
190
const multiPersonPartSegmentation = await estimatePartSegmentation ( ) ;
228
191
const coloredPartImageData = bodyPix . toColoredPartMask (
229
192
multiPersonPartSegmentation ,
230
193
partColorScales [ guiState . partMap . colorScale ]
231
194
) ;
232
-
233
195
const maskBlurAmount = 0 ;
234
196
switch ( guiState . partMap . effect ) {
235
197
case "pixelation" :
0 commit comments