`;

			canvasContainer.style.width = `${smallestWindowDimension}px`;
			canvasContainer.style.height = `${smallestWindowDimension}px`;

			canvasElement.height = videoHeight;
			canvasElement.width = videoWidth;
		}

		function onResults(results) {
			canvasCtx.save();
			canvasCtx.clearRect(0, 0, videoWidth, videoHeight);
			canvasCtx.drawImage(results.segmentationMask, 0, 0,
				videoWidth, videoHeight);

			// Only overwrite existing pixels.
			canvasCtx.globalCompositeOperation = 'source-in';
			canvasC