Skip to content

Commit e03fb1d

Browse files
committed
Display: fix multi-animal frame display
1 parent 014b96b commit e03fb1d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dlclive/display.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ def display_frame(self, frame, pose=None):
6363
"""
6464
im_size = (frame.shape[1], frame.shape[0])
6565
if pose is not None:
66-
if self.window is None:
67-
self.set_display(im_size, pose.shape[0])
68-
6966
img = Image.fromarray(frame)
7067
draw = ImageDraw.Draw(img)
68+
7169
if len(pose.shape) == 2:
7270
pose = pose[None]
7371

72+
if self.window is None:
73+
self.set_display(im_size=im_size, bodyparts=pose.shape[1])
74+
7475
for i in range(pose.shape[0]):
7576
for j in range(pose.shape[1]):
7677
if pose[i, j, 2] > self.pcutoff:

0 commit comments

Comments
 (0)