🐛 bodySegmentation only if we have input image

This commit is contained in:
2023-03-31 15:42:04 +02:00
parent 6271976dd6
commit a0949f3bff

View File

@@ -74,10 +74,10 @@ export default class BodySegmentation extends Node<typeof inputs, typeof outputs
async segmentPeople() { async segmentPeople() {
await this.initSegmenter(); await this.initSegmenter();
await waitForMedia(this.in.image.value); await waitForMedia(this.in.image.value);
const {width, height} = mediaSize(this.__in.image.value);
if (!this.in.image.value) { if (!this.in.image.value) {
return; return;
} }
const {width, height} = mediaSize(this.__in.image.value);
const originalImageCanvas = canvasPool2D.createCanvas(); const originalImageCanvas = canvasPool2D.createCanvas();
originalImageCanvas.width = width; originalImageCanvas.width = width;