Removed deprecated use of 'np.int' and replaced it with 'int'. Fixes numpy 1.24.0 and up compatibility.

This commit is contained in:
Kiri 2023-05-21 16:46:51 -07:00
parent 609a6290bc
commit d242009e0b
2 changed files with 2 additions and 2 deletions

View file

@ -251,7 +251,7 @@ def AdapWingLoss(pre_hm, gt_hm):
img_dilate = cv2.morphologyEx(img_merge, cv2.MORPH_DILATE, kernel) img_dilate = cv2.morphologyEx(img_merge, cv2.MORPH_DILATE, kernel)
img_dilate[img_dilate < 51] = 1 # 0*W+1 img_dilate[img_dilate < 51] = 1 # 0*W+1
img_dilate[img_dilate >= 51] = 11 # 1*W+1 img_dilate[img_dilate >= 51] = 11 # 1*W+1
img_dilate = np.array(img_dilate, dtype=np.int) img_dilate = np.array(img_dilate, dtype=int)
img_dilate = img_dilate.transpose(2, 0, 1) img_dilate = img_dilate.transpose(2, 0, 1)
dilated = torch.from_numpy(img_dilate).float() dilated = torch.from_numpy(img_dilate).float()
if first: if first:

View file

@ -920,7 +920,7 @@ class Tracker():
x1, y1 = clamp_to_im(center - radius, h, w) x1, y1 = clamp_to_im(center - radius, h, w)
x2, y2 = clamp_to_im(center + radius + 1, h, w) x2, y2 = clamp_to_im(center + radius + 1, h, w)
offset = np.array((x1, y1)) offset = np.array((x1, y1))
lms = (lms[:, 0:2] - offset).astype(np.int) lms = (lms[:, 0:2] - offset).astype(int)
frame = frame[y1:y2, x1:x2] frame = frame[y1:y2, x1:x2]
return frame, lms, offset return frame, lms, offset