fffiloni commited on
Commit
848b9af
·
1 Parent(s): 87520e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -51,7 +51,7 @@ def predict(img):
51
  print(f"POSE_RESULTS: {pose_results}")
52
 
53
  # create a black image of the same size as the original image
54
- black_img = np.zeros((height, width, 3), np.uint8)
55
 
56
  # iterate through each person in the POSE_RESULTS data
57
  for person in pose_results:
@@ -59,7 +59,8 @@ def predict(img):
59
  keypoints = person['keypoints']
60
 
61
  # draw lines between keypoints to form a skeleton
62
- skeleton = [(0,1), (1,2), (2,3), (3,4), (1,5), (5,6), (6,7), (1,8), (8,9), (9,10), (10,11), (8,12), (12,13), (13,14), (0,15), (15,16)]
 
63
  for i, j in skeleton:
64
  if keypoints[i][2] < 0.1 or keypoints[j][2] < 0.1:
65
  continue
 
51
  print(f"POSE_RESULTS: {pose_results}")
52
 
53
  # create a black image of the same size as the original image
54
+ black_img = np.zeros((width, height, 3), np.uint8)
55
 
56
  # iterate through each person in the POSE_RESULTS data
57
  for person in pose_results:
 
59
  keypoints = person['keypoints']
60
 
61
  # draw lines between keypoints to form a skeleton
62
+ #skeleton = [(0,1), (1,2), (2,3), (3,4), (1,5), (5,6), (6,7), (1,8), (8,9), (9,10), (10,11), (8,12), (12,13), (13,14), (0,15), (15,16)]
63
+ skeleton = [(0,1), (1,2), (3,4), (4,5), (2,6), (5,7), (2,3), (3,8), (8,9), (9,10), (10,11), (8,12), (12,13), (13,14), (1,0), (6,2), (11,5)]
64
  for i, j in skeleton:
65
  if keypoints[i][2] < 0.1 or keypoints[j][2] < 0.1:
66
  continue