font_color = (20, 165, 255)
line_type = 8
font_type = cv2.FONT_HERSHEY_DUPLEX
# Draw the rectangle with some text to indicate the region.
if label == 0:
cv2.putText(frame, "Down Right", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 1:
cv2.putText(frame, "Right", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 2:
cv2.putText(frame, "Up Right", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 3:
cv2.putText(frame, "Down", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 4:
cv2.putText(frame, "Middle", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 5:
cv2.putText(frame, "Up", (1024, 440 - 15), font_type, 3, font_color, line_type)
cv2.rectangle(overlay,
elif label == 6:
cv2.putText(frame, "Down Left", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
elif label == 7:
cv2.putText(frame, "Left", (1024, 440 - 15), font_type, 3, font_color,
line_type)
cv2.rectangle(overlay,
AWS DeepLens Guía para desarrolladores
Crear y ejecutar el proyecto de
detección de posición de cabeza
(frame.shape[1] // 3 * 2 + rect_margin,
frame.shape[0] // 3 * 2 + rect_margin),
(frame.shape[1] // 3 * 2 + rect_width,
frame.shape[0] // 3 * 2 + rect_height),
(0, 255, 0), -1)
(frame.shape[1] // 3 * 2 + rect_margin,
frame.shape[0] // 3 * 1 + rect_margin),
(frame.shape[1] // 3 * 2 + rect_width,
frame.shape[0] // 3 * 1 + rect_height),
(0, 255, 0), -1)
(frame.shape[1] // 3 * 2 + rect_margin, rect_margin),
(frame.shape[1] // 3 * 2 + rect_width, rect_height),
(0, 255, 0), -1)
(frame.shape[1] // 3 * 1 + rect_margin,
frame.shape[0] // 3 * 2 + rect_margin),
(frame.shape[1] // 3 * 1 + rect_width,
frame.shape[0] // 3 * 2 + rect_height),
(0, 255, 0), -1)
(frame.shape[1] // 3 * 1 + rect_margin,
frame.shape[0] // 3 * 1 + rect_margin),
(frame.shape[1] // 3 * 1 + rect_width,
frame.shape[0] // 3 * 1 + rect_height),
(0, 255, 0), -1)
(frame.shape[1] // 3 * 1 + rect_margin, rect_margin),
(frame.shape[1] // 3 * 1 + rect_width, rect_height),
(0, 255, 0), -1)
(rect_margin, frame.shape[0] // 3 * 2 + rect_margin),
(rect_width, frame.shape[0] // 3 * 2 + rect_height),
(0, 255, 0), -1)
(rect_margin, frame.shape[0] // 3 * 1 + rect_margin),
(rect_width, frame.shape[0] // 3 * 1 + rect_height),
106