tx.drawImage(
				results.image, 0, 0, videoWidth, videoHeight);

			canvasCtx.restore();
		}

		const selfieSegmentation = new SelfieSegmentation({
			locateFile: (file) => {
				return `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`;
			}
		});
		selfieSegmentation.setOptions({
			selfieMode: true,
			modelSelection: 0,
		});
		selfieSegmentation.onResults(onResults);

		function startCamera() {
			const mode = facingMode[facingModeIndex];
			video = document.createElement('video');
