mediapipe
mediapipe copied to clipboard
ValueError: Task runner is currently not running.
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
Ubuntu 22.04.4 LTS
MediaPipe Tasks SDK version
0.10.11
Task name (e.g. Image classification, Gesture recognition etc.)
Pose Landmark Detection
Programming Language and version (e.g. C++, Python, Java)
Python
Describe the actual behavior
Task runner is not currently running when
frame_timestamp_ms = mp.Timestamp.from_seconds(timestamps).value
mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=image)
results = pose.detect_for_video(mp_image, frame_timestamp_ms)
Describe the expected behavior
results = pose.detect_for_video(mp_image, frame_timestamp_ms)
This command crashes and returns the ValueError: Task runner is currently not running
Standalone code/steps you may have used to try to get what you need
The legacy solution works:
self.mp_pose = mp.solutions.pose
self.pose_detector = self.mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.5,
min_tracking_confidence=0.5)
The current version does not:
options = PoseLandmarkerOptions(
base_options=BaseOptions(model_asset_path=model_path),
running_mode=VisionRunningMode.VIDEO)
with PoseLandmarker.create_from_options(options) as pose_replay:
pose_replay
Other info / Complete Logs
pose <mediapipe.tasks.python.vision.pose_landmarker.PoseLandmarker object at 0x7f992c2b08d0>
File "/lib/python3.11/site-packages/mediapipe/tasks/python/vision/core/base_vision_task_api.py", line 119, in _process_video_data
return self._runner.process(inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Task runner is currently not running.
@schmidt-sebastian it seems like there should be an easy answer, any advise?
Hi @mcdonasd1212,
Apologies for the delayed response. Could you kindly share more details, including the standalone code you are using and the Python version, to help us reproduce the issue and gain a better understanding?
Thank you!!
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.
This issue was closed due to lack of activity after being marked stale for past 7 days.