Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
No
OS Platform and Distribution
windows11
Mobile device if the issue happens on mobile device
No response
Browser and version if the issue happens on browser
No response
Programming Language and version
python
MediaPipe version
0.10.10
Bazel version
No response
Solution
Pose
Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
No response
Xcode & Tulsi version (if issue is related to building for iOS)
No response
Describe the actual behavior
I try to run the example code(Describe the actual behavior) on vscode, but I can't run the code because of the error.I checked the information on github, but still have no clue (if a similar issue has been discussed, I may have missed it)
Describe the expected behaviour
I hope to run the code on vscode successfully.
Standalone code/steps you may have used to try to get what you need
#this is the code
# STEP 1: Import the necessary modules.
import cv2
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
from mediapipe import solutions
from mediapipe.framework.formats import landmark_pb2
import numpy as np
import os
def draw_landmarks_on_image(rgb_image, detection_result):
pose_landmarks_list = detection_result.pose_landmarks
annotated_image = np.copy(rgb_image)
# Loop through the detected poses to visualize.
for idx in range(len(pose_landmarks_list)):
pose_landmarks = pose_landmarks_list[idx]
# Draw the pose landmarks.
pose_landmarks_proto = landmark_pb2.NormalizedLandmarkList()
pose_landmarks_proto.landmark.extend([
landmark_pb2.NormalizedLandmark(x=landmark.x, y=landmark.y, z=landmark.z) for landmark in pose_landmarks
])
mp.solutions.drawing_utils.draw_landmarks(
annotated_image,
pose_landmarks_proto,
mp.solutions.pose.POSE_CONNECTIONS,
mp.solutions.drawing_styles.get_default_pose_landmarks_style())
return annotated_image
# STEP 2: Create an PoseLandmarker object.
base_options = python.BaseOptions(model_asset_path="C:/Users/April/OneDrive/文件/Visual-inspection/pose_landmarker_heavy.task")
options = vision.PoseLandmarkerOptions(
base_options=base_options,
output_segmentation_masks=True)
detector = vision.PoseLandmarker.create_from_options(options)
# STEP 3: Load the input image.
image = mp.Image.create_from_file("image.jpg")
# STEP 4: Detect pose landmarks from the input image.
detection_result = detector.detect(image)
# STEP 5: Process the detection result. In this case, visualize it.
annotated_image = draw_landmarks_on_image(image.numpy_view(), detection_result)
cv2.imshow(cv2.cvtColor(annotated_image, cv2.COLOR_RGB2BGR))
cv2.waitKey(0)
cv2.destroyAllWindows()
Other info / Complete Logs
#those are the errors
Traceback (most recent call last):
File "c:\Users\April\OneDrive\文件\Visual-inspection\face_track.py", line 37, in <module>
detector = vision.PoseLandmarker.create_from_options(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\April\anaconda3\envs\visual-inspetion\Lib\site-packages\mediapipe\tasks\python\vision\pose_landmarker.py", line 319, in create_from_options
return cls(
^^^^
File "C:\Users\April\anaconda3\envs\visual-inspetion\Lib\site-packages\mediapipe\tasks\python\vision\core\base_vision_task_api.py", line 70, in __init__
self._runner = _TaskRunner.create(graph_config, packet_callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Unable to open file at C:\Users\April\OneDrive\文件\Visual-inspection\pose_landmarker_heavy.task, errno=-1
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
No
OS Platform and Distribution
windows11
Mobile device if the issue happens on mobile device
No response
Browser and version if the issue happens on browser
No response
Programming Language and version
python
MediaPipe version
0.10.10
Bazel version
No response
Solution
Pose
Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
No response
Xcode & Tulsi version (if issue is related to building for iOS)
No response
Describe the actual behavior
I try to run the example code(Describe the actual behavior) on vscode, but I can't run the code because of the error.I checked the information on github, but still have no clue (if a similar issue has been discussed, I may have missed it)
Describe the expected behaviour
I hope to run the code on vscode successfully.
Standalone code/steps you may have used to try to get what you need
Other info / Complete Logs