[Python] FileNotFoundError: The path does not exist , while using mediapipe for hand detection

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to accomplish hand detection on webcam feed using mediapipe, but when I run the code I get the following error:

    **File "D:\HandTracking\handtracking.py", line 9, in <module>
    hands = mpHands.Hands()**

    **File "C:\Users\Θανάσης\AppData\Local\Programs\Python\Python39\lib\site-packages\mediapipe\python\solutions\hands.py", line 109, in __init__
    super().__init__(**

    **File "C:\Users\Θανάσης\AppData\Local\Programs\Python\Python39\lib\site-packages\mediapipe\python\solution_base.py", line 237, in __init__
    validated_graph.initialize(
    FileNotFoundError: The path does not exist.**

    **[ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-1i5nllza\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback**


    The code is:

    import cv2 as cv
    import mediapipe as mp

    capture = cv.VideoCapture(0)
    mpHands = mp.solutions.hands
    hands = mpHands.Hands()

    while True:
    isTrue, frame = capture.read()
    frameRGB = cv.cvtColor(frame, cv.COLOR_BGR2RGB)
    results = hands.process(frameRGB)
    cv.imshow("Frame", frame)

    if cv.waitKey(20) & 0xFF == ord('d'):
    break

    capture.release()
    cv.destroyAllWindows()

    Continue reading...

Compartilhe esta Página