fffiloni commited on
Commit
a2ecd8f
·
1 Parent(s): 46676c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -67,8 +67,10 @@ def predict(img):
67
 
68
  # draw circles at each keypoint
69
  for i in range(keypoints.shape[0]):
70
- pt = (int(keypoints[i][0]), int(keypoints[i][1]))
71
- cv2.circle(black_img, pt, 3, (255, 255, 255), thickness=-1, lineType=cv2.LINE_AA)
 
 
72
 
73
  # write black_img to a jpg file
74
  cv2.imwrite("output.jpg", black_img)
 
67
 
68
  # draw circles at each keypoint
69
  for i in range(keypoints.shape[0]):
70
+ if keypoints[i][2] > 0.0: # check if the keypoint is visible
71
+ pt = (int(keypoints[i][0]), int(keypoints[i][1]))
72
+ cv2.circle(black_img, pt, 3, (255, 255, 255), thickness=-1, lineType=cv2.LINE_AA)
73
+
74
 
75
  # write black_img to a jpg file
76
  cv2.imwrite("output.jpg", black_img)