mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

ValueError: Task runner is currently not running.

Open mcdonasd1212 opened this issue 1 year ago • 2 comments

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.

mcdonasd1212 avatar May 01 '24 00:05 mcdonasd1212

@schmidt-sebastian it seems like there should be an easy answer, any advise?

mcdonasd1212 avatar May 01 '24 13:05 mcdonasd1212

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!!

kuaashish avatar May 07 '24 07:05 kuaashish

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.

github-actions[bot] avatar May 15 '24 01:05 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar May 23 '24 01:05 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar May 23 '24 01:05 google-ml-butler[bot]