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)
- Have I written custom code (as opposed to using a stock example script provided in MediaPipe): NO
- Browser and version (e.g. Google Chrome, Safari) if the issue happens on browser: Chrome 101.0.4951.64 MacOS
- Programming Language and version ( e.g. C++, Python, Java): JAVASCRIPT
- MediaPipe version: “@mediapipe/camera_utils”: “^0.3.1640029074”, “@mediapipe/selfie_segmentation”: “^0.1.1632777926”
- Solution ( e.g. FaceMesh, Pose, Holistic ): @mediapipe/camera_utils @mediapipe/selfie_segmentation
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:
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)"
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 19
Hello team, any update on it, please?