-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconst.go
195 lines (175 loc) · 5.02 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
package openpose
const TotalBodyParts = 18
// CocoPart represents body parts
type CocoPart int
const (
// CocoPartNose nose
CocoPartNose CocoPart = iota
// CocoPartNeck neck
CocoPartNeck
// CocoPartRShoulder right sholder
CocoPartRShoulder
// CocoPartRElbow right elbow
CocoPartRElbow
// CocoPartRWrist right wrist
CocoPartRWrist
// CocoPartLShoulder left sholder
CocoPartLShoulder
// CocoPartLElbow left elbow
CocoPartLElbow
// CocoPartLWrist left wrist
CocoPartLWrist
// CocoPartRHip right hip
CocoPartRHip
// CocoPartRKnee right knee
CocoPartRKnee
// CocoPartRAnkle right ankle
CocoPartRAnkle
// CocoPartLHip left hip
CocoPartLHip
// CocoPartLKnee left knee
CocoPartLKnee
// CocoPartLAnkle left ankle
CocoPartLAnkle
// CocoPartREye right eye
CocoPartREye
// CocoPartLEye left eye
CocoPartLEye
// CocoPartREar right ear
CocoPartREar
// CocoPartLEar left ear
CocoPartLEar
// CocoPartBackground background
CocoPartBackground
)
// MPIIPart MPII human parts
type MPIIPart int
const (
// MPIIPartRAnkle right ankle
MPIIPartRAnkle MPIIPart = iota
// MPIIPartRKnee right knee
MPIIPartRKnee
MPIIPartRHip
// MPIIPartLHip left hip
MPIIPartLHip
// MPIIPartLKnee left knee
MPIIPartLKnee
// MPIIPartLAnkle left ankle
MPIIPartLAnkle
// MPIIPartRWrist right wrist
MPIIPartRWrist
// MPIIPartRElbow right elbow
MPIIPartRElbow
// MPIIPartRShoulder right sholder
MPIIPartRShoulder
// MPIIPartLShoulder left sholder
MPIIPartLShoulder
// MPIIPartLElbow left elbow
MPIIPartLElbow
// MPIIPartLWrist left wrist
MPIIPartLWrist
// MPIIPartNeck neck
MPIIPartNeck
// MPIIPartHead head
MPIIPartHead
)
// PartPair represents pose part MPIIPart, CocoPart pair
type PartPair struct {
MPIIPart MPIIPart
CocoPart CocoPart
}
// PartPairs represents MPIIPart, CocoPart pair list
var PartPairs = []PartPair{
{MPIIPartHead, CocoPartNose},
{MPIIPartNeck, CocoPartNeck},
{MPIIPartRShoulder, CocoPartRShoulder},
{MPIIPartRElbow, CocoPartRElbow},
{MPIIPartRWrist, CocoPartRWrist},
{MPIIPartLShoulder, CocoPartLShoulder},
{MPIIPartLElbow, CocoPartLElbow},
{MPIIPartLWrist, CocoPartLWrist},
{MPIIPartRHip, CocoPartRHip},
{MPIIPartRKnee, CocoPartRKnee},
{MPIIPartRAnkle, CocoPartRAnkle},
{MPIIPartLHip, CocoPartLHip},
{MPIIPartLKnee, CocoPartLKnee},
{MPIIPartLAnkle, CocoPartLAnkle},
}
// CocoPairs coco part pairs
var CocoPairs = [][2]CocoPart{
{CocoPartNeck, CocoPartRShoulder}, {CocoPartNeck, CocoPartLShoulder}, {CocoPartRShoulder, CocoPartRElbow},
{CocoPartRElbow, CocoPartRWrist}, {CocoPartLShoulder, CocoPartLElbow}, {CocoPartLElbow, CocoPartLWrist},
{CocoPartNeck, CocoPartRHip}, {CocoPartRHip, CocoPartRKnee}, {CocoPartRKnee, CocoPartRAnkle},
{CocoPartNeck, CocoPartLHip}, {CocoPartLHip, CocoPartLKnee}, {CocoPartLKnee, CocoPartLAnkle},
{CocoPartNeck, CocoPartNose},
{CocoPartNose, CocoPartREye}, {CocoPartREye, CocoPartREar},
{CocoPartNose, CocoPartLEye}, {CocoPartLEye, CocoPartLEar},
{CocoPartRShoulder, CocoPartREar},
{CocoPartLShoulder, CocoPartLEar},
}
// CocoPairNetwork .
var CocoPairsNetwork = [][2]CocoPart{
{12, 13}, {20, 21}, {14, 15}, {16, 17}, {22, 23}, {24, 25}, {0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}, {10, 11}, {28, 29}, {30, 31}, {34, 35}, {32, 33}, {36, 37}, {18, 19}, {26, 27},
}
// CocoPairsRender represents coco pairs for render
var CocoPairsRender = CocoPairs[0 : len(CocoPairs)-2]
// CocoColors represents color for coco parts
var CocoColors = [][3]uint8{
{255, 0, 0}, {255, 85, 0}, {255, 170, 0}, {255, 255, 0}, {170, 255, 0}, {85, 255, 0}, {0, 255, 0}, {0, 255, 85}, {0, 255, 170}, {0, 255, 255}, {0, 170, 255}, {0, 85, 255}, {0, 0, 255}, {85, 0, 255}, {170, 0, 255}, {255, 0, 255}, {255, 0, 170}, {255, 0, 85},
}
// CoordParts represents CocoParts for coordinate
var CoordParts = []CocoPart{
CocoPartNose,
CocoPartNeck,
CocoPartRShoulder,
CocoPartLShoulder,
CocoPartRHip,
CocoPartLHip,
CocoPartREye,
CocoPartLEye,
CocoPartREar,
CocoPartLEar,
}
// CoordPartsMap represents CocoParts for coordinate in map
var CoordPartsMap = map[CocoPart]struct{}{
CocoPartNose: {},
CocoPartNeck: {},
CocoPartRShoulder: {},
CocoPartLShoulder: {},
CocoPartRHip: {},
CocoPartLHip: {},
CocoPartREye: {},
CocoPartLEye: {},
CocoPartREar: {},
CocoPartLEar: {},
}
const (
ThresholdPartConfidence float32 = 0.3
InterThreashold float32 = 0.1
InterMinAboveThreshold int = 6
NMS_Threshold float64 = 0.1
MinSubsetCnt int = 4
MinSubsetScore float32 = 0.8
ThresholdHumanScore float32 = 0.4
)
const (
DefaultSharpenSigma float64 = 0.0
)
// ModelSize size for training image
type ModelSize [2]int
var (
ModelSizeBest ModelSize = [2]int{1312, 736}
ModelSizeBetter ModelSize = [2]int{656, 368}
ModelSizeCMU ModelSize = [2]int{640, 360}
ModelSizeDefault ModelSize = [2]int{432, 368}
ModelSizeFaster ModelSize = [2]int{336, 288}
ModelSizeFatest ModelSize = [2]int{304, 240}
)
// ModelType represents type of mode graph
type ModelType int
const (
// CMU cmu model graph
CMU ModelType = iota
// MobileNetmodelnet model graph
MobileNet
)