acmyu commited on
Commit
45fa020
·
1 Parent(s): d18ce0f

undo pose colors

Browse files
Files changed (1) hide show
  1. libs/easy_dwpose/draw/openpose.py +15 -24
libs/easy_dwpose/draw/openpose.py CHANGED
@@ -36,33 +36,24 @@ def draw_bodypose(canvas, candidate, subset):
36
  ]
37
 
38
  colors = [
39
- [0, 255, 255],
40
- [255, 255, 255],
41
-
42
- # arm-r
43
- [255, 0, 170],
44
- [255, 0, 255],
45
- [170, 0, 255],
46
-
47
- # arm-l
48
- [0, 85, 0],
49
- [0, 255, 0],
50
- [0, 170, 0],
51
-
52
- #leg-r
53
- [255, 85, 0],
54
  [255, 0, 0],
55
- [255, 0, 85],
56
-
57
- # leg-l
58
- [0, 85, 255],
59
- [0, 0, 255],
60
- [85, 0, 255],
61
-
62
  [170, 255, 0],
 
 
 
63
  [0, 255, 170],
64
- [255, 255, 0],
65
  [0, 170, 255],
 
 
 
 
 
 
 
66
  ]
67
 
68
 
@@ -81,7 +72,7 @@ def draw_bodypose(canvas, candidate, subset):
81
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
82
  angle = math.degrees(math.atan2(X[0] - X[1], Y[0] - Y[1]))
83
  polygon = cv2.ellipse2Poly((int(mY), int(mX)), (int(length / 2), stickwidth), int(angle), 0, 360, 1)
84
- cv2.fillConvexPoly(canvas, polygon, colors[j[1]])
85
 
86
  canvas = (canvas * 0.6).astype(np.uint8)
87
 
 
36
  ]
37
 
38
  colors = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  [255, 0, 0],
40
+ [255, 85, 0],
41
+ [255, 170, 0],
42
+ [255, 255, 0],
 
 
 
 
43
  [170, 255, 0],
44
+ [85, 255, 0],
45
+ [0, 255, 0],
46
+ [0, 255, 85],
47
  [0, 255, 170],
48
+ [0, 255, 255],
49
  [0, 170, 255],
50
+ [0, 85, 255],
51
+ [0, 0, 255],
52
+ [85, 0, 255],
53
+ [170, 0, 255],
54
+ [255, 0, 255],
55
+ [255, 0, 170],
56
+ [255, 0, 85],
57
  ]
58
 
59
 
 
72
  length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
73
  angle = math.degrees(math.atan2(X[0] - X[1], Y[0] - Y[1]))
74
  polygon = cv2.ellipse2Poly((int(mY), int(mX)), (int(length / 2), stickwidth), int(angle), 0, 360, 1)
75
+ cv2.fillConvexPoly(canvas, polygon, colors[i])
76
 
77
  canvas = (canvas * 0.6).astype(np.uint8)
78