Skip to content

Commit cc2b84d

Browse files
committed
Update examples.py
1 parent da000ca commit cc2b84d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dlclivegui/processors/examples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ def process(self, pose, **kwargs):
148148
# Calculate weighted center from head keypoints
149149
head_xy = xy[[0, 1, 2, 3, 4, 5, 6, 26], :]
150150
head_conf = conf[[0, 1, 2, 3, 4, 5, 6, 26]]
151-
center = np.average(head_xy, axis=0, weights=head_conf)
151+
try:
152+
center = np.average(head_xy, axis=0, weights=head_conf)
153+
except ZeroDivisionError:
154+
center = np.zeros(2)
152155

153156
# Calculate body axis (tail_base -> neck)
154157
body_axis = xy[7] - xy[13]

0 commit comments

Comments
 (0)