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

简介: 1. (arg0: bool) -> mediapipe.python._framework_bindings.packet.Packet

调用姿态估计库 mp.solutions.pose.Pose,出现下面的问题

Traceback (most recent call last):
  File "D:/cv/feilei/cc.py", line 11, in <module>
    detector = PoseDetector()
  File "D:\cv\feilei\poseutil.py", line 32, in __init__
    self.min_detection_confidence, self.min_tracking_confidence)
  File "D:\ProgramData\Anaconda3\lib\site-packages\mediapipe\python\solutions\pose.py", line 162, in __init__
    outputs=['pose_landmarks', 'pose_world_landmarks', 'segmentation_mask'])
  File "D:\ProgramData\Anaconda3\lib\site-packages\mediapipe\python\solution_base.py", line 260, in __init__
    for name, data in (side_inputs or {}).items()
  File "D:\ProgramData\Anaconda3\lib\site-packages\mediapipe\python\solution_base.py", line 260, in <dictcomp>
    for name, data in (side_inputs or {}).items()
  File "D:\ProgramData\Anaconda3\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

这个是由于版本更新了,新增了个参数:enable_segmentation=False,加上即可。

# 创建一个Pose对象用于检测人体姿势
        self.pose = mp.solutions.pose.Pose(self.static_image_mode, self.upper_body_only, self.smooth_landmarks,
                                           self.min_detection_confidence, self.min_tracking_confidence)

改为:

self.pose = mp.solutions.pose.Pose(self.static_image_mode, self.upper_body_only, self.smooth_landmarks,False,self.min_detection_confidence, self.min_tracking_confidence)
目录
相关文章
|
3月前
python-argparse模块使用
python-argparse模块使用
14 0
|
5月前
|
Python
Python参数解析工具argparse.ArgumentParser()
Python参数解析工具argparse.ArgumentParser()
|
数据库
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matching
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matching
602 0
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matching
|
9月前
|
Python 容器
【Python标准库】argparse的add_argument() 方法介绍
【Python标准库】argparse的add_argument() 方法介绍
|
9月前
|
程序员 Go API
|
11月前
|
程序员 Go Windows
【go 语言】解决 grpc:--proto_path passed empty directory name. (Use "." for current directory.)
【go 语言】解决 grpc:--proto_path passed empty directory name. (Use "." for current directory.)
134 0
|
索引 Python
argparser Python包使用
argparser Python包使用
106 0
|
iOS开发
cocos2dx-bullet物理引擎编译的一个问题: Argument value 10880 is outside the valid range
cocos2dx-bullet物理引擎编译的一个问题: Argument value 10880 is outside the valid range
197 0
python——argparse 模块(1)
python——argparse 模块(1)
|
Python 容器
python——argparse 模块(2)
python——argparse 模块(2)