MCPcopy Index your code
hub / github.com/Vegetebird/GraphMLP / show2Dpose

Function show2Dpose

demo/vis.py:29–51  ·  view source on GitHub ↗
(kps, img)

Source from the content-addressed store, hash-verified

27
28
29def show2Dpose(kps, img):
30 colors = [(255, 128, 255),
31 (255, 127, 127),
32 (127, 127, 255)]
33
34 connections = [[0, 1], [1, 2], [2, 3], [0, 4], [4, 5],
35 [5, 6], [0, 7], [7, 8], [8, 9], [9, 10],
36 [8, 11], [11, 12], [12, 13], [8, 14], [14, 15], [15, 16]]
37
38 LR = [3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]
39
40 thickness = 3
41
42 for j,c in enumerate(connections):
43 start = map(int, kps[c[0]])
44 end = map(int, kps[c[1]])
45 start = list(start)
46 end = list(end)
47 cv2.line(img, (start[0], start[1]), (end[0], end[1]), colors[LR[j]-1], thickness)
48 cv2.circle(img, (start[0], start[1]), thickness=-1, color=colors[LR[j]-1], radius=3)
49 cv2.circle(img, (end[0], end[1]), thickness=-1, color=colors[LR[j]-1], radius=3)
50
51 return img
52
53
54def show3Dpose(vals, ax, fix_z):

Callers 1

get_pose3DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected