```python
mediapipe中部分方法有,部分没有,是什么原因呢?
错误提示如下:
D:\sw\vs\Python36_64\python.exe E:/python程序/PycharmProjects/untitled2/单张图片手势检测.py
Traceback (most recent call last):
File "E:/python程序/PycharmProjects/untitled2/单张图片手势检测.py", line 11, in <module>
mp_drawing_styles = mp.solutions.drawing_styles
AttributeError: module 'mediapipe.python.solutions' has no attribute 'drawing_styles'
Process finished with exit code 1
# 时间:2022/5/9 0009 13:11
import cv2
import matplotlib.pyplot as plt
import numpy as np
import math
import mediapipe as mp
from tqdm import tqdm
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
def show(img, name):
cv2.imshow(name, img)
cv2.waitKey(0)
cv2.destroyAllWindows()
def look_img(img):
img_RGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img_RGB)

plt.show()
path1 = r'C:\Users\Administrator\Desktop\d7634e4968dde4a806e7d5c4ae84b1d8.jpeg'
img1 = cv2.imread(path1)
img1_mirror = cv2.flip(img1, 1)
img1_RGB = cv2.cvtColor(img1_mirror, cv2.COLOR_BGR2RGB)
look_img(img1_mirror)
hands = mp_hands.Hands(static_image_mode=False, # 图片还是还是视频
max_num_hands=4, # 检测几只手
min_detection_confidence=0.5, # 置信度阈值
min_tracking_confidence=0.5) # 追踪阈值
mpDraw = mp.solutions.drawing_utils
results = hands.process(img1_RGB)
