79712529

Date: 2025-07-23 20:35:22
Score: 0.5
Natty:
Report link

Thanks for help, I change a little bit inputs, reinstal python and lybraries to have path set automaticly and finnaly its giving me hand landmarks :)
First hand landmarks: [NormalizedLandmark(x=0.35780423879623413, y=0.005128130316734314, z=7.445843266395968e-07, visibility=0.0, presence=0.0),

What I finally have is:

import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
from mediapipe.tasks.python.core.base_options import BaseOptions
# Use an absolute path
task_path = Path(__file__).parent / "hand_landmarker.task"

print("Resolved model path:", task_path)

if not task_path.exists():
    raise FileNotFoundError(f"Model file not found at: {task_path}")

options = HandLandmarkerOptions(
    base_options=BaseOptions(model_asset_path=str(task_path.resolve())),
    running_mode=VisionRunningMode.IMAGE,
    num_hands=2
)

detector = vision.HandLandmarker.create_from_options(options)
# Hands
mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv2.cvtColor(cv2_image, cv2.COLOR_BGR2RGB))
hands_results = detector.detect(mp_image)
results['hands'] = hands_results.hand_landmarks
hand_landmarks = results.get('hands')
first_hand = hand_landmarks[0] if hand_landmarks and len(hand_landmarks) > 0 else None
print("First hand landmarks:", first_hand)
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Anastasiya Miklashevich