maya2022 python3 通过pip扩展模块

一、Win窗口键+r键打开运行对话框,输入cmd回车运行命令提示符。
二、cd+空格+maya运行目录C:\Program Files\Autodesk\Maya2022\bin

三、输入mayapy -m pip install <标志> –user <软件包>命令格式安装扩展包,
比如mayapy -m pip install mediapipe -i https://mirrors.aliyun.com/pypi/simple/

比如mayapy -m pip install opencv-python==4.5.4.58 -i https://mirrors.aliyun.com/pypi/simple/

import cv2
import mediapipe as mp
import matplotlib.pyplot as plt
import numpy as np
mp_pose = mp.solutions.pose
pose = mp_pose.Pose(static_image_mode=True, # 静态图片
model_complexity=2, # 性能好但慢
# Smooth_landmarks=True, # 是否平滑关键点
# enable_segmentation=True, # 是否人体抠图
min_detection_confidence=0.5) #
img = cv2.imread(‘C:\\Users\\Administrator\\Pictures\\82MG1Cb.jpg’)
results = pose.process(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
# landmarks = results.pose_landmarks.landmark
landmarks3d = results.pose_world_landmarks.landmark
print(landmarks3d[mp_pose.PoseLandmark.NOSE.value])
print(landmarks3d[mp_pose.PoseLandmark.NOSE.value].x)
print(landmarks3d[mp_pose.PoseLandmark.NOSE.value].y)
print(landmarks3d[mp_pose.PoseLandmark.NOSE.value].z)

print(landmarks[mp_pose.PoseLandmark.NOSE.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_EYE_INNER.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_EYE.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_EYE_OUTER.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_EYE_INNER.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_EYE.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_EYE_OUTER.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_EAR.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_EAR.value])
print(landmarks[mp_pose.PoseLandmark.MOUTH_LEFT.value])
print(landmarks[mp_pose.PoseLandmark.MOUTH_RIGHT.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_SHOULDER.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_SHOULDER.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_ELBOW.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_ELBOW.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_WRIST.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_WRIST.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_PINKY.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_PINKY.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_INDEX.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_INDEX.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_THUMB.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_THUMB.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_HIP.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_HIP.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_KNEE.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_KNEE.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_ANKLE.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_ANKLE.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_HEEL.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_HEEL.value])
print(landmarks[mp_pose.PoseLandmark.LEFT_FOOT_INDEX.value])
print(landmarks[mp_pose.PoseLandmark.RIGHT_FOOT_INDEX.value])

评论0

请先
显示验证码
没有账号?注册  忘记密码?

社交账号快速登录