124 for index, landmark
in enumerate(landmarks.landmark):
125 if landmark.visibility < 0
or landmark.presence < 0:
continue
127 landmark_x = min(int(landmark.x * iw), iw - 1)
128 landmark_y = min(int(landmark.y * ih), ih - 1)
131 lpx.append(landmark_x)
132 lpy.append(landmark_y)
135 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
137 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
139 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
141 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
143 helper.drawCircle(landmark_x, landmark_y, 5, col,
False)
144 helper.drawCircle(landmark_x, landmark_y, 12, col,
True)
146 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
148 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
150 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
152 helper.drawCircle(landmark_x, landmark_y, 5, col,
False)
153 helper.drawCircle(landmark_x, landmark_y, 12, col,
True)
155 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
157 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
159 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
161 helper.drawCircle(landmark_x, landmark_y, 5, col,
False)
162 helper.drawCircle(landmark_x, landmark_y, 12, col,
True)
164 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
166 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
168 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
170 helper.drawCircle(landmark_x, landmark_y, 5, col,
False)
171 helper.drawCircle(landmark_x, landmark_y, 12, col,
True)
173 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
175 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
177 helper.drawCircle(landmark_x, landmark_y, 5, col,
True)
179 helper.drawCircle(landmark_x, landmark_y, 5, col,
False)
180 helper.drawCircle(landmark_x, landmark_y, 12, col,
True)
183 helper.drawLine(lpx[2], lpy[2], lpx[3], lpy[3], col)
184 helper.drawLine(lpx[3], lpy[3], lpx[4], lpy[4], col)
186 helper.drawLine(lpx[5], lpy[5], lpx[6], lpy[6], col)
187 helper.drawLine(lpx[6], lpy[6], lpx[7], lpy[7], col)
188 helper.drawLine(lpx[7], lpy[7], lpx[8], lpy[8], col)
190 helper.drawLine(lpx[9], lpy[9], lpx[10], lpy[10], col)
191 helper.drawLine(lpx[10], lpy[10], lpx[11], lpy[11], col)
192 helper.drawLine(lpx[11], lpy[11], lpx[12], lpy[12], col)
194 helper.drawLine(lpx[13], lpy[13], lpx[14], lpy[14], col)
195 helper.drawLine(lpx[14], lpy[14], lpx[15], lpy[15], col)
196 helper.drawLine(lpx[15], lpy[15], lpx[16], lpy[16], col)
198 helper.drawLine(lpx[17], lpy[17], lpx[18], lpy[18], col)
199 helper.drawLine(lpx[18], lpy[18], lpx[19], lpy[19], col)
200 helper.drawLine(lpx[19], lpy[19], lpx[20], lpy[20], col)
202 helper.drawLine(lpx[0], lpy[0], lpx[1], lpy[1], col)
203 helper.drawLine(lpx[1], lpy[1], lpx[2], lpy[2], col)
204 helper.drawLine(lpx[2], lpy[2], lpx[5], lpy[5], col)
205 helper.drawLine(lpx[5], lpy[5], lpx[9], lpy[9], col)
206 helper.drawLine(lpx[9], lpy[9], lpx[13], lpy[13], col)
207 helper.drawLine(lpx[13], lpy[13], lpx[17], lpy[17], col)
208 helper.drawLine(lpx[17], lpy[17], lpx[0], lpy[0], col)
210 helper.drawCircle(cx, cy, 5, 0xffff8080,
True)
213 if handedness.classification[0].label[0] ==
'L': hnd =
'R'
215 helper.drawText(cx - 2, cy - 3, hnd, 0xffff0000)