Solution to the error "module 'mediapipe.python.solutions.face_mesh' has no attribute 'FACE_CONNECTIONS'"

An unknown college student, known as a dish dog in the world of martial arts
original author: Jacky Li
Email: [email protected]

Time of completion:2023.9.16
Last edited: 2023.9.16

Table of contents

Error details

Editing online transmission solution:

Correct solution


Error details

When using the Face Mesh module in MediaPipe for face detection, if you encounter the following error when calling the computer camera or reading the computer video:

AttributeError: module ‘mediapipe.python.solutions.face_mesh’ has no attribute 'FACE_CONNECTIONS'

Network transmission solution:

Modify the FACE_CONNECTIONS in the above picture to FACE_CONTOURS and it will run normally. The blogger gained true knowledge through practice, but found that it is not available for the following reasons:

A new error was generated, as shown below:

D:\miniconda\envs\pytorch\python.exe C:\Users\ASUS\Desktop\66.py 
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
  File "C:\Users\ASUS\Desktop\66.py", line 42, in <module>
    connections=mp_face_mesh.FACE_CONTOURS,
AttributeError: module 'mediapipe.python.solutions.face_mesh' has no attribute 'FACE_CONTOURS'

And since we couldn't find a solution for this issue , we can only continue to solve the problem before the first part is modified!

Correct solution

That's right, just change FACE_CONNECTIONS to FACEMESH_CONTOURS and it will run normally. The blogger gained true knowledge through practice and found that it works! !

The author has something to say

If you feel that what the blogger said is useful to you, please click "Follow" to support it. We will continue to update such issues...

Guess you like

Origin blog.csdn.net/weixin_62075168/article/details/132914715