每次创建任务运行程序时, mediapipe 都会向 DOM 添加 <script> 标签
作者: tzahola创建于 2024年10月24日更新于 2026年9月30日
标签type:supportplatform:javascriptstat:awaiting googlertask:image segmentation
每当您使用 `ImageSegmenter.createWithOptions({wasmBinaryPath: ..., wasmLoaderPath: ...})` 创建 `ImageSegmenter` 时,就会在文档中添加一个带有 `wasmLoaderPath` 的 `<script>` 元素。如果稍后创建了新实例,则会在 DOM 中追加另一个 `<script>`。每次都是如此。如果 mediapipe 仅在相关脚本尚未加载时将 `<script>` 添加到 DOM 中,则可以防止应用程序在其 DOM 中积累许多冗余节点。
内容来源: google-ai-edge/mediapipe