Skip to content

Commit

Permalink
Update aiModel.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Freedisch authored Feb 12, 2024
1 parent f2bc7e3 commit 638b2d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aimodel/trainedmodel/aiModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
while True:
success, img = cap.read()
img = cv2.resize(img, (1280, 720))
# img = cv2.imread("AiTrainer/test.jpg")

img = detector.findPose(img, False)
lmList = detector.findPosition(img, False)
# print(lmList)
if len(lmList) != 0:
# Right Arm
angle = detector.findAngle(img, 12, 14, 16)

# # Left Arm
#angle = detector.findAngle(img, 11, 13, 15,False)
per = np.interp(angle, (210, 310), (0, 100))
bar = np.interp(angle, (220, 310), (650, 100))
# print(angle, per)

# Check for the dumbbell curls
color = (255, 0, 255)
if per == 100:
Expand Down Expand Up @@ -50,4 +50,4 @@
cv2.putText(img, str(int(fps)), (50, 100), cv2.FONT_HERSHEY_PLAIN, 5,
(255, 0, 0), 5)
cv2.imshow("Image", img)
cv2.waitKey(1)
cv2.waitKey(1)

0 comments on commit 638b2d4

Please sign in to comment.