Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Human_Pose_Estimation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# python-pose-estimation
in this repository we are going to create a python pose estimation

<h1>steps to install:</h1>
<p>1.download the requirements.txt.</p>
<p>2.download the droidcam app in your mobile to use it with the mobile cam.</p>
<p>3.and you can simply use your computer web cam by leaving the brackets blank.</p>
<p>5.check the cap = cap = cv2.VideoCapture('http://192.168.27.101:4748/video').</p>
<p>6.change the url to your droidcam url. </p>
<p>7.run the main.py</p>

you can also use the PoseModule.py it is a simple module
36 changes: 36 additions & 0 deletions Human_Pose_Estimation/main.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions Human_Pose_Estimation/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
opencv-python
mediapipe