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

can't open my camera on laptop #5823

Open
Liunan0329 opened this issue Jan 15, 2025 · 3 comments
Open

can't open my camera on laptop #5823

Liunan0329 opened this issue Jan 15, 2025 · 3 comments
Assignees
Labels
legacy:face mesh Issues related to Face Mesh os:windows MediaPipe issues on Windows platform:python MediaPipe Python issues stat:awaiting response Waiting for user response type:support General questions

Comments

@Liunan0329
Copy link

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

Win11

MediaPipe Tasks SDK version

No response

Task name (e.g. Image classification, Gesture recognition etc.)

face detection

Programming Language and version (e.g. C++, Python, Java)

Python

Describe the actual behavior

show the log info and then exit the process without any error or warning

Describe the expected behaviour

run the code successfully

Standalone code/steps you may have used to try to get what you need

import mediapipe as mp import cv2 as cv mp_draw = mp.solutions.drawing_utils mp_face = mp.solutions.face_mesh faces = mp_face.FaceMesh(min_detection_confidence = 0.7,min_tracking_confidence = 0.7) v = cv.VideoCapture(0) while(v.isOpened()): ret,frame = v.read() if ret is not True: print("read frame error!") break m_frame = cv.cvtColor(frame,cv.COLOR_BGR2RGB) face_res = faces.process(m_frame) if face_res.multi_face_landmarks: for facemarks in face_res.multi_face_landmarks: mp_draw(frame,facemarks,mp_face.FACEMESH_TESSELATION) cv.imshow("camera",frame) cv.waitKey(0) v.release() cv.destroyAllWindows()

Other info / Complete Logs

No response

@Liunan0329
Copy link
Author

test code is as follows:

import mediapipe as mp
import cv2 as cv

mp_draw = mp.solutions.drawing_utils
mp_face = mp.solutions.face_mesh
faces = mp_face.FaceMesh(min_detection_confidence = 0.7,min_tracking_confidence = 0.7)

v = cv.VideoCapture(0)

while(v.isOpened()):
ret,frame = v.read()
if ret is not True:
print("read frame error!")
break
m_frame = cv.cvtColor(frame,cv.COLOR_BGR2RGB)

face_res = faces.process(m_frame)

if face_res.multi_face_landmarks:
    for facemarks in face_res.multi_face_landmarks:
        mp_draw(frame,facemarks,mp_face.FACEMESH_TESSELATION)

cv.imshow("camera",frame)
cv.waitKey(0)

v.release()
cv.destroyAllWindows()

@kuaashish kuaashish added os:windows MediaPipe issues on Windows legacy:face detection Issues related to Face Detection platform:python MediaPipe Python issues type:support General questions legacy:face mesh Issues related to Face Mesh and removed legacy:face detection Issues related to Face Detection labels Jan 15, 2025
@kuaashish
Copy link
Collaborator

Hi @Liunan0329,

We regret to inform you that the solution you are currently using is based on a legacy face mesh model, which has been discontinued. This model has been replaced by the updated Face Landmarker Task API. We strongly recommend migrating to the new Task APIs.

You can find the overview of the new Face Landmarker API here, the Python examples guide here, and a Python Colab example here. Please transition to the new Face Landmarker API, and let us know if you encounter any similar issues with the new solution.

Additionally, we will no longer be able to provide support for the legacy face mesh model.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 16, 2025
@kuaashish
Copy link
Collaborator

Hi @Liunan0329,

Kindly review the above and let us know if we can update the status to proceed with closing the issue and marking it as resolved internally. If you encounter any issues with the upgraded Face Landmarker Task API, please raise a new issue with complete details, and we will assist you.

Thank you!!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Jan 22, 2025
@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:face mesh Issues related to Face Mesh os:windows MediaPipe issues on Windows platform:python MediaPipe Python issues stat:awaiting response Waiting for user response type:support General questions
Projects
None yet
Development

No branches or pull requests

2 participants