added exercises plank and sit up
This commit is contained in:
4
main.py
4
main.py
@@ -20,7 +20,7 @@ count = 0
|
|||||||
stage = None
|
stage = None
|
||||||
mode = 'p' # default: push-ups
|
mode = 'p' # default: push-ups
|
||||||
|
|
||||||
HINT = '[P]ush [U]pull [B]ench [C]url [R]eset [Q]uit'
|
HINT = '[P]ush [U]pull [B]ench [C]url [S]itup [L]plank [R]eset [Q]uit'
|
||||||
|
|
||||||
with mp_pose.Pose(min_detection_confidence=0.6, min_tracking_confidence=0.6) as pose:
|
with mp_pose.Pose(min_detection_confidence=0.6, min_tracking_confidence=0.6) as pose:
|
||||||
while cap.isOpened():
|
while cap.isOpened():
|
||||||
@@ -54,7 +54,7 @@ with mp_pose.Pose(min_detection_confidence=0.6, min_tracking_confidence=0.6) as
|
|||||||
cv2.rectangle(image, (0, 0), (w, 80), (15, 15, 15), -1)
|
cv2.rectangle(image, (0, 0), (w, 80), (15, 15, 15), -1)
|
||||||
cv2.putText(image, ex['name'], (12, 30),
|
cv2.putText(image, ex['name'], (12, 30),
|
||||||
cv2.FONT_HERSHEY_SIMPLEX, 0.85, color, 2)
|
cv2.FONT_HERSHEY_SIMPLEX, 0.85, color, 2)
|
||||||
cv2.putText(image, f'REPS: {count}', (12, 68),
|
cv2.putText(image, f'{ex["unit"]}: {count}', (12, 68),
|
||||||
cv2.FONT_HERSHEY_SIMPLEX, 1.3, (0, 255, 0), 3)
|
cv2.FONT_HERSHEY_SIMPLEX, 1.3, (0, 255, 0), 3)
|
||||||
cv2.putText(image, (stage or '---').upper(), (w - 108, 50),
|
cv2.putText(image, (stage or '---').upper(), (w - 108, 50),
|
||||||
cv2.FONT_HERSHEY_SIMPLEX, 0.9, (180, 180, 0), 2)
|
cv2.FONT_HERSHEY_SIMPLEX, 0.9, (180, 180, 0), 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user