From 4b10dfc5fb24af027e5bf1eef5204139db571764 Mon Sep 17 00:00:00 2001 From: leafiber Date: Wed, 8 Jun 2022 16:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0:MP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=20=EF=BC=88=E8=A2=AB=E5=8A=A8=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E8=B0=83=E6=95=B4=E5=A4=8D=E6=9D=82=E7=B3=BB=E6=95=B0?= =?UTF-8?q?=E4=B8=BA1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/demo.py b/demo.py index a411694..734b4ee 100644 --- a/demo.py +++ b/demo.py @@ -27,14 +27,16 @@ class HandDetector: self.results = None self.mode = mode self.max_hands = max_hands - self.modelComplex = False + self.modelComplex = 1 self.detection_con = detection_con self.min_track_con = min_track_con # 初始化手部的识别模型 self.mpHands = mp.solutions.hands - self.hands = self.mpHands.Hands(self.mode, self.max_hands, self.modelComplex, - self.detection_con, self.min_track_con) + self.hands = self.mpHands.Hands(static_image_mode=self.mode, + max_num_hands=self.max_hands, + min_detection_confidence=self.detection_con, + min_tracking_confidence=self.min_track_con) self.mpDraw = mp.solutions.drawing_utils # 初始化绘图器 self.tipIds = [4, 8, 12, 16, 20] # 指尖列表 self.fingers = []