Skip to content

Commit c1e14af

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a7495f1 + e271582 commit c1e14af

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

common/visualization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def update_video(i):
170170

171171
for n, ax in enumerate(ax_3d):
172172
pos = poses[n][i]
173-
lines_3d[n][j - 1][0].set_xdata([pos[j, 0], pos[j_parent, 0]])
173+
lines_3d[n][j - 1][0].set_xdata(np.array([pos[j, 0], pos[j_parent, 0]])) # Hotfix matplotlib's bug. https://github.com/matplotlib/matplotlib/pull/20555
174174
lines_3d[n][j - 1][0].set_ydata([pos[j, 1], pos[j_parent, 1]])
175175
lines_3d[n][j - 1][0].set_3d_properties([pos[j, 2], pos[j_parent, 2]], zdir='z')
176176

joints_detectors/Alphapose/fn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import cv2
77
import numpy as np
88
import torch
9-
from torch._six import string_classes, int_classes
9+
from torch._six import string_classes
1010

1111
RED = (0, 0, 255)
1212
GREEN = (0, 255, 0)
@@ -57,7 +57,7 @@ def collate_fn(batch):
5757
if elem.shape == (): # scalars
5858
py_type = float if elem.dtype.name.startswith('float') else int
5959
return numpy_type_map[elem.dtype.name](list(map(py_type, batch)))
60-
elif isinstance(batch[0], int_classes):
60+
elif isinstance(batch[0], int):
6161
return torch.LongTensor(batch)
6262
elif isinstance(batch[0], float):
6363
return torch.DoubleTensor(batch)
@@ -194,7 +194,7 @@ def vis_frame(frame, im_res, format='coco'):
194194
bg = img.copy()
195195
cv2.circle(bg, (int(cor_x / 2), int(cor_y / 2)), 2, p_color[n], -1)
196196
# Now create a mask of logo and create its inverse mask also
197-
transparency = max(0, min(1, kp_scores[n]))
197+
transparency = max(0, min(1, kp_scores[n].item()))
198198
img = cv2.addWeighted(bg, transparency, img, 1 - transparency, 0)
199199

200200
# Draw proposal score on the head
@@ -219,7 +219,7 @@ def vis_frame(frame, im_res, format='coco'):
219219
polygon = cv2.ellipse2Poly((int(mX), int(mY)), (int(length / 2), int(stickwidth)), int(angle), 0, 360, 1)
220220
cv2.fillConvexPoly(bg, polygon, line_color[i])
221221
# cv2.line(bg, start_xy, end_xy, line_color[i], (2 * (kp_scores[start_p] + kp_scores[end_p])) + 1)
222-
transparency = max(0, min(1, 0.5 * (kp_scores[start_p] + kp_scores[end_p])))
222+
transparency = max(0, min(1, 0.5 * (kp_scores[start_p] + kp_scores[end_p]).item()))
223223
img = cv2.addWeighted(bg, transparency, img, 1 - transparency, 0)
224224
img = cv2.resize(img, (width, height), interpolation=cv2.INTER_CUBIC)
225225
return img

pose_trackers/PoseFlow/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ opencv_contrib_python==3.4.2.16
55
matplotlib==2.2.2
66
tqdm==4.23.4
77
Image==1.5.25
8-
Pillow==6.2.0
8+
Pillow==8.2.0
99
munkres==1.0.12

0 commit comments

Comments
 (0)