【无标题】

D:\anaconda\envs\torch11\python.exe “F:/xm/juli/有趣好玩/Opencv-project-main/CVZone/20 Pose Estimation/ExampleProject.py”
Traceback (most recent call last):
File “F:/xm/juli/有趣好玩/Opencv-project-main/CVZone/20 Pose Estimation/ExampleProject.py”, line 7, in
detector = pm.poseDetector()
File “F:\xm\juli\有趣好玩\Opencv-project-main\CVZone\20 Pose Estimation\PoseModule.py”, line 21, in init
self.detectionCon, self.trackCon)
File “D:\anaconda\envs\torch11\lib\site-packages\mediapipe\python\solutions\pose.py”, line 162, in init
outputs=[‘pose_landmarks’, ‘pose_world_landmarks’, ‘segmentation_mask’])
File “D:\anaconda\envs\torch11\lib\site-packages\mediapipe\python\solution_base.py”, line 260, in init
for name, data in (side_inputs or {}).items()
File “D:\anaconda\envs\torch11\lib\site-packages\mediapipe\python\solution_base.py”, line 260, in
for name, data in (side_inputs or {}).items()
File “D:\anaconda\envs\torch11\lib\site-packages\mediapipe\python\solution_base.py”, line 513, in make_packet
return getattr(packet_creator, 'create
’ + packet_data_type.value)(data)
TypeError: create_bool(): incompatible function arguments. The following argument types are supported:
1. (arg0: bool) -> mediapipe.python._framework_bindings.packet.Packet

Invoked with: 0.5
[ WARN:0@4.163] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace’::SourceReaderCB::~SourceReaderCB terminating async callback

Process finished with exit code 1

和
	return getattr(packet_creator, 'create_' + packet_data_type.value)(data)

TypeError: create_bool(): incompatible function arguments. The following argument types are supported:
1. (arg0: bool) -> mediapipe.python._framework_bindings.packet.Packet

Invoked with: 0.5

更改文件
class poseDetector():
def init(self, mode=False,upBody=False, modComplexity=1, smooth=True, eSegmentation=False, sSegmentation=True, detectionCon=0.5, trackCon=0.5):

    self.mode = mode
    self.upBody = upBody
    self.smooth = smooth
    self.detectionCon = detectionCon
    self.trackCon = trackCon

    self.eSegmentation =eSegmentation
    self.sSegmentation =sSegmentation
    self.modComplexity = modComplexity
    self.mpDraw = mp.solutions.drawing_utils
    self.mpPose = mp.solutions.pose
    # self.pose = self.mpPose.Pose(self.mode, self.upBody, self.smooth,
    #                              self.detectionCon, self.trackCon)
    '''Code Here'''
    self.pose = self.mpPose.Pose(self.mode, self.modComplexity, self.smooth, self.eSegmentation, self.sSegmentation,
                                 self.detectionCon, self.trackCon)
    '''Rest CODE'''

问题2
TypeError: create_int(): incompatible function arguments. The following argument types
are supported:

  1. (arg0: int) -> mediapipe.python._framework_bindings.packet.Packet

Invoked with: 0.5
[ WARN:0] global D:\a\opencv-python\opencv-
python\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-
namespace’::SourceReaderCB::~SourceReaderCB terminating async callback

从:self.hands = self.mpHands.Hands(self.mode, self.maxHands, self.detectionCon, self.trackCon)
到:self.hands = self.mpHands.Hands(self.mode, self.maxHands, self.modelComplex, self.detectionCon, self.trackCon)
加一参数
class handDetector():
def init(self, mode=False, maxHands=1, modelComplexity=1, detectionCon=0.5, trackCon=0.5):
self.mode = mode
self.maxHands = maxHands
self.modelComplex = modelComplexity
self.detectionCon = detectionCon
self.trackCon = trackCon

    self.mpHands = mp.solutions.hands
    self.hands = self.mpHands.Hands(self.mode, self.maxHands, self.modelComplex, 
                                    self.detectionCon, self.trackCon)

问题3
hands, img = detector.findHands(img, flipType=False) # 上面反转过了,这里就不用再翻转了
TypeError: findHands() got an unexpected keyword argument ‘flipType’
[ WARN:0@10.347] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace’::SourceReaderCB::~SourceReaderCB terminating async callback

缺少参数flipType传入并编辑
不过大部分的此类问题都能在不同版本中找到相应的需求
我的是1.4.x

问题4

imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’

问题一般为img 传入路径出现问题

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值