AttributeError: module 'mediapipe.python.solutions.hands' has no attribute 'hands' #5410
Labels
legacy:hands
Hand tracking/gestures/etc
platform:python
MediaPipe Python issues
stale
stat:awaiting response
Waiting for user response
type:support
General questions
I had using Spider to write python program
Has anyone had this error when importing the mediapipe library? AttributeError: partially initialized module 'mediapipe' has no attribute 'hands'
Standalone code/steps you may have used to try to get what you need###
import cv2
import mediapipe as mp
cap = cv2.VideoCapture(0)
mpHands = mp.solutions.hands
hands = mpHands.hands()
while True:
ret, img = cap.read()
if ret:
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
results = hands.process(imgRGB)
print(results.mulit_hand_landmarks)
cv2.imshow('img', img)
if cv2.waitKey(10) == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
The text was updated successfully, but these errors were encountered: