Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception has occurred: ModuleNotFoundError #48

Open
cadytto opened this issue Aug 16, 2022 · 2 comments
Open

Exception has occurred: ModuleNotFoundError #48

cadytto opened this issue Aug 16, 2022 · 2 comments

Comments

@cadytto
Copy link

cadytto commented Aug 16, 2022

Exception has occurred: ModuleNotFoundError
No module named 'cvzone'
File "C:\Users\Bella\Desktop\sign language\venv\test'.py", line 1, in
from cvzone.HandTrackingModule import HandDetector

hi! i have already installed cvzone and restarted my laptop, how can I fix this error?

from cvzone.HandTrackingModule import HandDetector
import cv2

cap = cv2.VideoCapture(0)
detector = HandDetector(detectionCon=0.8, maxHands=2)
while True:
# Get image frame
success, img = cap.read()
# Find the hand and its landmarks
hands, img = detector.findHands(img) # with draw
# hands = detector.findHands(img, draw=False) # without draw

if hands:
    # Hand 1
    hand1 = hands[0]
    lmList1 = hand1["lmList"]  # List of 21 Landmark points
    bbox1 = hand1["bbox"]  # Bounding box info x,y,w,h
    centerPoint1 = hand1['center']  # center of the hand cx,cy
    handType1 = hand1["type"]  # Handtype Left or Right

    fingers1 = detector.fingersUp(hand1)

    if len(hands) == 2:
        # Hand 2
        hand2 = hands[1]
        lmList2 = hand2["lmList"]  # List of 21 Landmark points
        bbox2 = hand2["bbox"]  # Bounding box info x,y,w,h
        centerPoint2 = hand2['center']  # center of the hand cx,cy
        handType2 = hand2["type"]  # Hand Type "Left" or "Right"

        fingers2 = detector.fingersUp(hand2)

        # Find Distance between two Landmarks. Could be same hand or different hands
        length, info, img = detector.findDistance(lmList1[8], lmList2[8], img)  # with draw
        # length, info = detector.findDistance(lmList1[8], lmList2[8])  # with draw
# Display
cv2.imshow("Image", img)
cv2.waitKey(1)

cap.release()
cv2.destroyAllWindows()

I got the code from the examples here

@Aries2003
Copy link

I hav trick for it install cvzone 1.5.4 and msvc-runtime

@Aries2003
Copy link

If u r looking for newer version sorry i can't help there I'm still trying to find a solution for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants