【无标题】

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</p> <p>Process finished with exit code 1</p> <pre><code>和 return getattr(packet_creator, 'create_' + packet_data_type.value)(data) </code></pre> <p>TypeError: create_bool(): incompatible function arguments. The following argument types are supported: 1. (arg0: bool) -> mediapipe.python._framework_bindings.packet.Packet</p> <p>Invoked with: 0.5</p> <p>更改文件 class poseDetector(): def <strong>init</strong>(self, mode=False,upBody=False, modComplexity=1, smooth=True, eSegmentation=False, sSegmentation=True, detectionCon=0.5, trackCon=0.5):</p> <pre><code> 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''' </code></pre> <p>问题2 TypeError: create_int(): incompatible function arguments. The following argument types are supported:</p> <p>Invoked with: 0.5 [ WARN:0] global D:\a\opencv-python\opencv- python\opencv\modules\videoio\src\cap_msmf.cpp (438)
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 传入路径出现问题

Original: https://blog.csdn.net/qq_51946265/article/details/124078643
Author: Είναι η κοπέλα
Title: 【无标题】

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/704227/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球