shaokaiye commited on
Commit
9e66710
β€’
1 Parent(s): 4eaaf09

Update viz_utils.py

Browse files
Files changed (1) hide show
  1. viz_utils.py +4 -0
viz_utils.py CHANGED
@@ -66,6 +66,10 @@ def draw_keypoints_on_image(image,
66
  # draw ellipses around keypoints
67
  for i, (keypoint_x, keypoint_y) in enumerate(zip(keypoints_x, keypoints_y)):
68
  round_fill = list(cm.viridis(norm(colores[i]),bytes=True))#[round(num*255) for num in list(cmap(i))[:3]] #check!
 
 
 
 
69
  if np.isnan(alpha[i]) == False :
70
  round_fill[3] = round(alpha[i] *255)
71
  #print(round_fill)
 
66
  # draw ellipses around keypoints
67
  for i, (keypoint_x, keypoint_y) in enumerate(zip(keypoints_x, keypoints_y)):
68
  round_fill = list(cm.viridis(norm(colores[i]),bytes=True))#[round(num*255) for num in list(cmap(i))[:3]] #check!
69
+ # handling potential nans in the keypoints
70
+ if np.isnan(keypoint_x).any():
71
+ continue
72
+
73
  if np.isnan(alpha[i]) == False :
74
  round_fill[3] = round(alpha[i] *255)
75
  #print(round_fill)