Skip to content

Commit 57ff561

Browse files
committed
cleanup
1 parent f4a7df6 commit 57ff561

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

src/pages/body-pix/index.js

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function BodyPix() {
6767
await loadBodyPix();
6868
await loadVideo(guiState.camera);
6969

70-
let cameras = await getVideoInputs();
70+
// let cameras = await getVideoInputs();
7171

7272
// setupFPS();
7373
// setupGui(cameras);
@@ -185,51 +185,13 @@ export default function BodyPix() {
185185
if (!canvas.current) return
186186
if (!videoElement.current) return
187187
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;
225188
case "partmap":
226189
const ctx = canvas.current.getContext("2d");
227190
const multiPersonPartSegmentation = await estimatePartSegmentation();
228191
const coloredPartImageData = bodyPix.toColoredPartMask(
229192
multiPersonPartSegmentation,
230193
partColorScales[guiState.partMap.colorScale]
231194
);
232-
233195
const maskBlurAmount = 0;
234196
switch (guiState.partMap.effect) {
235197
case "pixelation":

0 commit comments

Comments
 (0)