sfmig commited on
Commit
2042455
·
1 Parent(s): c4bc253

fixed wrong kpts locations

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -41,8 +41,8 @@ def draw_keypoints_on_image(image,
41
  # font = ImageFont.truetype("sans-serif.ttf", 16)
42
 
43
  im_width, im_height = image.size
44
- keypoints_x = [k[1] for k in keypoints]
45
- keypoints_y = [k[0] for k in keypoints]
46
 
47
  # adjust keypoints coords if required
48
  if use_normalized_coordinates:
@@ -142,10 +142,10 @@ def predict_dlc(list_np_crops,
142
  keypts_xyp = dlc_live.get_pose(crop) # third column is llk!
143
  # ATT! coord syst for keypoints is bottom left corner? change here to top left for PIL coord system
144
  pdb.set_trace()
145
- keypts_xyp = np.column_stack((crop.shape[1]-keypts_xyp[:,0],
146
- crop.shape[0]-keypts_xyp[:,1],
147
- keypts_xyp[:,2]))
148
- pdb.set_trace()
149
  # set kpts below threhsold to nan
150
  keypts_xyp[keypts_xyp[:,-1] < kpts_likelihood_th,:] = np_aux.fill(np.nan)
151
  # add kpts of this crop to list
 
41
  # font = ImageFont.truetype("sans-serif.ttf", 16)
42
 
43
  im_width, im_height = image.size
44
+ keypoints_x = [k[0] for k in keypoints]
45
+ keypoints_y = [k[1] for k in keypoints]
46
 
47
  # adjust keypoints coords if required
48
  if use_normalized_coordinates:
 
142
  keypts_xyp = dlc_live.get_pose(crop) # third column is llk!
143
  # ATT! coord syst for keypoints is bottom left corner? change here to top left for PIL coord system
144
  pdb.set_trace()
145
+ # keypts_xyp = np.column_stack((crop.shape[1]-keypts_xyp[:,0],
146
+ # crop.shape[0]-keypts_xyp[:,1],
147
+ # keypts_xyp[:,2]))
148
+ # pdb.set_trace()
149
  # set kpts below threhsold to nan
150
  keypts_xyp[keypts_xyp[:,-1] < kpts_likelihood_th,:] = np_aux.fill(np.nan)
151
  # add kpts of this crop to list