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月前
|
C# Python
Python Tricks : Function Argument Unpacking
Python Tricks : Function Argument Unpacking
29 1
|
7月前
|
人工智能 C++ Windows
[NextJs] 解决 Failed to load SWC binary for win32/64
快速解决 Next.js 在 Windows 下运行时 SWC Binary 报错的方法,包括安装 Microsoft Visual C++ Redistributable 和确认处理器架构。
|
6月前
|
数据处理 开发者 索引
【Python】已解决:FutureWarning: The frame.append method is deprecated and will be removed from pandas in
【Python】已解决:FutureWarning: The frame.append method is deprecated and will be removed from pandas in
418 0
|
8月前
|
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
65 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
1267 0
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matching
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
|
Python 容器
【Python标准库】argparse的add_argument() 方法介绍
【Python标准库】argparse的add_argument() 方法介绍
MAC编译OpenJDK8:error: ‘&&‘ within ‘||‘ [-Werror,-Wlogical-op-parentheses]
MAC编译OpenJDK8:error: ‘&&‘ within ‘||‘ [-Werror,-Wlogical-op-parentheses]
107 0
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决h5py\_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'logits'
成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'logits'