google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.81k stars 5.18k forks source link

Object detection stops when it runs long time #5422

Open pahotari opened 6 months ago

pahotari commented 6 months ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

Chrome Version 125.0.6422.61

MediaPipe Tasks SDK version

Mediapipe/task-vision 0.10.12

Task name (e.g. Image classification, Gesture recognition etc.)

Object detection

Programming Language and version (e.g. C++, Python, Java)

Javasrcipt

Describe the actual behavior

Object detection stops when it runs long time

Describe the expected behaviour

Object detection should not stop

Standalone code/steps you may have used to try to get what you need

I am using Mediapipe/task-vision 0.10.12 for object detection. I have made a JavaScript web application that uses Mediapipe/task-vision for object detection from a video stream. The solution works quite well.
My solution is based on these guidelines: https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector/web_js

However, I noticed that if the object detection runs for over ten days, it stops, and I need to restart the detection. Additionally, I observed that the web browser logs the following messages:

Could this be the reason why the detection stops? Is there any way to work around the problem, and how can I increase the max_queue_size?

Other info / Complete Logs

AW0520 vision_wasm_internal.js:1
03:33:20.076000 1935920
calculator_graph.cc:1293] Resolved
a deadlock by increasing max_queue_size of input stream: "norm_rect" of a node "mediapipe_tasks_vision_objectdetectoraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" to 101. Consider increasing max_queue_size for better performance.

AW0520 vision_wasm_internal.js:1
03:33:20.827000 1935920
calculator_graph.cc:1293] Resolved
a deadlock by increasing max_queue_size of input stream: "norm_rect" of a node "mediapipe_tasks_vision_objectdetectoraph__mediapipe_tasks_components_processors_imagepreprocessinggraph__ImageToTensorCalculator" to 201. Consider increasing max_queue_size for better performance.
kuaashish commented 6 months ago

Hi @pahotari,

Could you please try using version 0.10.14? If the issue persists, please provide the complete error logs for further analysis.

Thank you!!

github-actions[bot] commented 6 months ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

pahotari commented 6 months ago

Hi, I'll try new version and then I'll report how it goes. It will take for a while.

pahotari commented 4 months ago

I tried with version 0.10.14. Object detection works smoothly about 9 days, but then there happens next wasm logs (see attached picture) and detection somehow freeze. S-log