I can't access to a specific landmarks with the new API using "vision.PoseLandmarker"
I used to use
import cv2
import mediapipe as mp
mp_pose = mp.solutions.pose
mp_drawing = mp.solutions.drawing_utils
cap = cv2.VideoCapture("video.mp4")
with mp_pose.Pose(
static_image_mode = False) as pose:
if results.pose_landmarks is not None:
x1 = int(results.pose_landmarks.landmark[16].x * width)
y1 = int(results.pose_landmarks.landmark[16].y * height)
I tried use the official guide:
but it was impossible
The method to get a specific landmark with the new API is:
x1 = int(results.pose_landmarks[0][mp_pose.PoseLandmark.NOSE].x * width)