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)
目录
相关文章
|
7月前
|
自然语言处理 编译器 C语言
【C++ 20 新特性】参数包初始化捕获的魅力 (“pack init-capture“ in C++20: A Deep Dive)
【C++ 20 新特性】参数包初始化捕获的魅力 (“pack init-capture“ in C++20: A Deep Dive)
113 0
|
2月前
|
C# Python
Python Tricks : Function Argument Unpacking
Python Tricks : Function Argument Unpacking
27 1
|
4月前
|
Python
【Python】解决Can‘t find model ‘en‘. It doesn‘t seem to be a shortcut link, a Python package or a valid
在使用以下代码时,报错Can’t find model ‘en’. It doesn’t seem to be a shortcut link, a Python package or a valid path to a data directory.
63 1
|
5月前
|
Python
【Python】已完美解决:ValueError: Of the four parameters: start, end, periods, and freq, exactly three must
【Python】已完美解决:ValueError: Of the four parameters: start, end, periods, and freq, exactly three must
46 0
|
7月前
|
C语言 计算机视觉
opencv 编译objects.a(vs_version.rc.obj)‘ is incompatible with i386:x86-64 output
opencv 编译objects.a(vs_version.rc.obj)‘ is incompatible with i386:x86-64 output
54 0
|
数据库
解决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
1191 0
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matching
|
编译器 C语言
__builtin_return_address()函数的使用方法
__builtin_return_address()函数的使用方法
262 1
|
Python
Python参数解析工具argparse.ArgumentParser()
Python参数解析工具argparse.ArgumentParser()
|
程序员 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.)
224 0
Python bug:ValueError: invalid literal for int() with base 10: ''
Python bug:ValueError: invalid literal for int() with base 10: ''