Real-Time Head Pose Estimation: A Python Tutorial with MediaPipe and OpenCV

preview_player
Показать описание

You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇

_____________________________________________________________

In this video 📝 we are going to do Head Pose Estimation with MediaPipe and OpenCV in Python. We are going to do face mesh detection to get the points used for pose estimation with OpenCV. MediaPipe has a lot of built-in customizable Machine Learning Solutions that we are going to take a look at in the upcoming videos. MediaPipe is the newest and fastest within machine learning solutions and can be run on common hardware which we are going to see throughout this tutorial.

If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.

_____________________________________________________________

_____________________________________________________________

_____________________________________________________________

📞 Connect with Me:

_____________________________________________________________

🎮 My Gear (Affiliate links):
🖥️ Desktop PC:

_____________________________________________________________

Tags:
#HeadPose #PoseEstimation #OpenCV #MediaPipe #ComputerVision #MachineLearning
Рекомендации по теме
Комментарии
Автор

Join My AI Career Program
Enroll in My School and Technical Courses

NicolaiAI
Автор

I'm trying to use some of your tutorials to make a couple of addons for a 3d software called blender, I really appreciate how thorough you are in your explanation of your code!

martians
Автор

Hey. Keep up this good work. Your computer vision videos are really interesting.

sergeantPepper_
Автор

Hello, why don't the positions of the 'img_h/2' and 'img_w/2' variables in the cam_matrix camera matrix on line 66 of the code have to be exactly reversed? What does it achieve for 'img_w/2' to be below?

hamza_celik
Автор

Hey Hi, This is simply awesome, but while I'm running code on my pc I'm getting a divided by zero exception at line 116( totalTime = end - start
) please give me clarity on this Nic. Thank you

jagadeeshnalliboina
Автор

i have questions. At line 83, why we time 360? angle[0] in the video is sin or cos, isn't it?

Eric-moeb
Автор

Hi Nicolai, I watched your video. It's Very good. I have a few questions. I try to put the lines above the pupils and I want the program to tell where it is looking. how can I do it?

hazar
Автор

Thank you for your video! But, module 'mediapipe' has no attribute 'solutions'. Where I can find it?

antonlukanov
Автор

Hello, i would like to add some details for anyone looking to implement this method. In the mediapipe doc it states that the z coordinate is in roughly the same scale as the x coordinate so you should also scale z with the image width. Next, the 3d points that you feed to solvePnP should be constant for every frame. That means you should keep the 3d points of a single frame and pass them with the 2d points of each new frame to the solvePnP function. Then the angles will actually be in degrees and will not need denormalization ( you should not multiply the angles with 360). You should however convert them to radians and use sin - cos functions to find the second (extended) point starting from the nose. The coordinates for this second point are (int(nose_landmark[0] - math.sin(y)*math.cos(x)*50, int(nose_landmark[1] + math.sin(x)*50) where the actual 3d length of this line is 50 and you can change it to make it larger or smaller. Dont hesitate to reply for more details!

spablaho
Автор

Do you end up not using nose_3d_projection? I see some pose estimation tutorials that use it but from my own use doesn't seem to be correct / robust

wilbsmond
Автор

Hi Nicolai . I wanna do the head pose estimation for image . what are the changes should I made? can you suggest

vaishalishiv
Автор

I want to get value of roll movement of my head, which part should I change?

hakankosebas
Автор

I need to add a time for directions, like when I turn right for two seconds it will give me turn right.. how can I did that? thanks a lot

hmolccl
Автор

Thanks for this video. This helped me troubleshoot a project I'm working on.
I'm working on a dataset tool that processes images of faces and exports data of the landmarks and the rotation angles (the pitch, roll, and yaw of the head).

rommix
Автор

Really interesting, thank you!
Could you tell me how how get visual code's intelisense working so I don't have to use the full path for mediapipe all the time? ie

'p_face_mesh = should be 'mp.solutions.facemesh' but then I don't get any intelisense.

SamHocking
Автор

The video really great, may I know where the center(origin) of face, I'm trying to inverse the rotation angle to make the face to the camera, thank you very much.

ehnxmwv
Автор

Dude this video was great. Is there any other tutorials on how to do this for makeup try on?
Or implementing 3d object on the user's face?

mahdihabibi
Автор

good video mate! can i add a closed eye and yawning function in this media pipe? could you do a video about it?

bondevega
Автор

The code hangs when there are more than 1 faces in the camera frame(After adding the attribute max_num_faces=2). Please help. Is my CPU not strong enough or what.

shounakmehendale
Автор

Hi,

Thanks for sharing this video.
I just want to know, How can I achieve same Pose Estimation by using javascript?

manojprasad