Close the image segmenter result.

This doesn't currently do anything useful, since we're running
tflite on the CPU, but might avoid bugs if we get GPU support.
This commit is contained in:
Juliusz Chroboczek
2024-12-13 22:59:53 +01:00
parent a38676c9f6
commit bf46a9d6c1
+1
View File
@@ -47,6 +47,7 @@ onmessage = e => {
let id = new ImageData(width, height); let id = new ImageData(width, height);
for(let i = 0; i < mask.length; i++) for(let i = 0; i < mask.length; i++)
id.data[4 * i + 3] = mask[i]; id.data[4 * i + 3] = mask[i];
result.close();
createImageBitmap(id).then(ib => { createImageBitmap(id).then(ib => {
postMessage({ postMessage({
bitmap: bitmap, bitmap: bitmap,