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
python opencv:ERROR: Could not find a version that satisfies the requirement opencv ERROR:
python opencv:ERROR: Could not find a version that satisfies the requirement opencv ERROR:
63 2
|
数据库
解决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() 方法介绍
|
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.)
129 0
|
Android开发
libx264.c:function X264_init: error: undefined reference to x264_encoder_open_142
libx264.c:function X264_init: error: undefined reference to x264_encoder_open_142
104 0
安装 xgboost 报错ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/fold
安装 xgboost 报错ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/fold
安装 xgboost 报错ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/fold
|
iOS开发
cocos2dx-bullet物理引擎编译的一个问题: Argument value 10880 is outside the valid range
cocos2dx-bullet物理引擎编译的一个问题: Argument value 10880 is outside the valid range
195 0
|
Python
Python编程:使用sys、argparse、click、fire实现命令行参数解析
Python编程:使用sys、argparse、click、fire实现命令行参数解析
191 0
成功解决absl.flags._exceptions.IllegalFlagValueError: flag --train_size=inf: Expect argument to be a str
成功解决absl.flags._exceptions.IllegalFlagValueError: flag --train_size=inf: Expect argument to be a str
成功解决gensim\matutils.py:737: FutureWarning: Conversion of the second argument of issubdtype from `int
成功解决gensim\matutils.py:737: FutureWarning: Conversion of the second argument of issubdtype from `int