diff --git a/demo.py b/demo.py index 737a67a..a811c0d 100644 --- a/demo.py +++ b/demo.py @@ -36,14 +36,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.knuckles = {'0': [4, 3, 2, 1], "1": [8, 7, 6, 5], "2": [12, 11, 10, 9], "3": [16, 15, 14, 13],