Mohammed Innat commited on
Commit
00cde0b
1 Parent(s): 6757927

Update handposedetect.py

Browse files
Files changed (1) hide show
  1. handposedetect.py +3 -3
handposedetect.py CHANGED
@@ -3,7 +3,7 @@ import mediapipe as mp
3
  import cv2
4
  from utils import read_n_resize
5
 
6
- def mp_hand_pose_detect_fn(image):
7
  mp_drawing = mp.solutions.drawing_utils
8
  mp_drawing_styles = mp.solutions.drawing_styles
9
  mp_hands = mp.solutions.hands
@@ -11,8 +11,8 @@ def mp_hand_pose_detect_fn(image):
11
  with mp_hands.Hands(
12
  static_image_mode=True,
13
  max_num_hands=5,
14
- min_detection_confidence=0.5
15
- ) as hands:
16
  image = cv2.flip(read_n_resize(image, read=False), 1)
17
  results = hands.process(image)
18
 
 
3
  import cv2
4
  from utils import read_n_resize
5
 
6
+ def mp_hand_pose_detect_fn(image, min_detect_conf=0.5):
7
  mp_drawing = mp.solutions.drawing_utils
8
  mp_drawing_styles = mp.solutions.drawing_styles
9
  mp_hands = mp.solutions.hands
 
11
  with mp_hands.Hands(
12
  static_image_mode=True,
13
  max_num_hands=5,
14
+ min_detection_confidence=min_detect_conf
15
+ ) as hands:
16
  image = cv2.flip(read_n_resize(image, read=False), 1)
17
  results = hands.process(image)
18