mediapipe: Error `selfieSegmentation.close()` to stop the video process - `Cannot pass deleted object as a pointer of type SolutionWasm`

Please make sure that this is a bug and also refer to the troubleshooting, FAQ documentation before raising any issues.

System information (Please provide as much relevant information as possible)

Describe the current behavior:

When executing selfieSegmentation.close() to stop the video process (Close OpenGL) it is throwing an error, I tried the MediaPipe - Selfie Segmentation official examples and if you include a button in HTML and execute the selfieSegmentation.close() in javascript it will thrown an error.

I tried many ways to stop the selfieSegmentation and Camera Utils to avoid a leak of memory when I’m not using anymore the virtual background video.

Ways:

  • Execute selfieSegmentation.close() (No success)
  • Set selfieSegmentation equal null (No success)
  • Set selfieSegmentation.onResult(() => {}) (No success)
  • Execute selfieSegmentation.reset() (No success)

Follow the image:

image-20220519-185221

Describe the expected behavior:

When executing selfieSegmentation.close() I want to stop the OpenGl process and requestAnimatedFrame to stop using the virtual background video feature to avoid a leak of memory.

Standalone code to reproduce the issue: Provide a reproducible test case that is the bare minimum necessary to replicate the problem. If possible, please share a link to Colab/repo link /any notebook:

You can try it here MediaPipe - Selfie Segmentation official examples and you need to include a button in HTML and execute the selfieSegmentation.close() in javascript, it will throw an error.

Other info / Complete Logs : Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached

"BindingError: Cannot pass deleted object as a pointer of type SolutionWasm*
    at BindingError.<anonymous> (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation_solution_simd_wasm_bin.js:9:136510)
    at new BindingError (eval at createNamedFunction (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation_solution_simd_wasm_bin.js:9:135404), <anonymous>:4:34)
    at throwBindingError (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation_solution_simd_wasm_bin.js:9:138087)
    at RegisteredPointer.nonConstNoSmartPtrRawPointerToWireType [as toWireType] (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation_solution_simd_wasm_bin.js:9:152816)
    at SolutionWasm$send [as send] (eval at new_ (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation_solution_simd_wasm_bin.js:9:161520), <anonymous>:7:28)
    at qa.h (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation.js:64:336)
    at ta (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation.js:14:299)
    at ua.next (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation.js:15:91)
    at h (https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation@0.1/selfie_segmentation.js:40:446)"

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 19

Most upvoted comments

Hello team, any update on it, please?