diff --git a/Human_Pose_Estimation/README.md b/Human_Pose_Estimation/README.md new file mode 100644 index 0000000..37df5d3 --- /dev/null +++ b/Human_Pose_Estimation/README.md @@ -0,0 +1,12 @@ +# python-pose-estimation +in this repository we are going to create a python pose estimation + +

steps to install:

+

1.download the requirements.txt.

+

2.download the droidcam app in your mobile to use it with the mobile cam.

+

3.and you can simply use your computer web cam by leaving the brackets blank.

+

5.check the cap = cap = cv2.VideoCapture('http://192.168.27.101:4748/video').

+

6.change the url to your droidcam url.

+

7.run the main.py

+ +you can also use the PoseModule.py it is a simple module \ No newline at end of file diff --git a/Human_Pose_Estimation/main.py b/Human_Pose_Estimation/main.py new file mode 100644 index 0000000..ed645d6 --- /dev/null +++ b/Human_Pose_Estimation/main.py @@ -0,0 +1,36 @@ +import cv2 +import mediapipe as mp +import time + + +mpDraw = mp.solutions.drawing_utils +mpPose = mp.solutions.pose +pose = mpPose.Pose()#you can change the parameters and change the settings as you needed. + + +cap = cv2.VideoCapture('http://192.168.0.101:4747/video')#use your droid url + +pTime = 0 + +while True: + success, img = cap.read() + imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) + results = pose.process(imgRGB) + #print(results.pose_landmarks) + if results.pose_landmarks: + mpDraw.draw_landmarks(img, results.pose_landmarks, mpPose.POSE_CONNECTIONS) + for id, lm in enumerate(results.pose_landmarks.landmark): + h, w, c = img.shape + print(id, lm) + cx, cy = int(lm.x * w), int(lm.y * h) + cv2.circle(img, (cx, cy), 5, (255, 0, 0), cv2.FILLED) + + cTime = time.time() + fps = 2.5/(cTime-pTime) + pTime = cTime + + cv2.putText(img, str(int(fps)), (70, 50), cv2.FONT_HERSHEY_PLAIN, 3, + (255, 0, 0), 3) + + cv2.imshow("Image", img) + cv2.waitKey(1) \ No newline at end of file diff --git a/Human_Pose_Estimation/requirements.txt b/Human_Pose_Estimation/requirements.txt new file mode 100644 index 0000000..e2a935f --- /dev/null +++ b/Human_Pose_Estimation/requirements.txt @@ -0,0 +1,2 @@ +opencv-python +mediapipe \ No newline at end of file