Pose is a Python script for live head pose estimation
Use the package manager pip to install dependencies.
pip install -r requirements.txtIf installing dlib throws an error, ensure the command line tools are installed.
xcode-select --installThen, using Homebrew, run:
brew install cmake
pip install cmake
brew install dlib
pip install dlibAlso ensure that shape_predictor_68.dat is located in the same folder as pose.py
In pose.py, edit the following to match your webcam's framerate:
# CHANGE FRAMERATE ACCORDING TO WEBCAM
vs = VideoStream(src=0, framerate=30).start()You can now run the script as follows: (press "q" to quit)
python3 pose.pyIf you would like to use the video output file feature, you will also need to edit the output framerate to approximately match the average framerate you received running the script on your hardware.
out = cv2.VideoWriter(
"poseEstimate.mp4",
cv2.VideoWriter_fourcc(*"mp4v"),
15, # REPLACE WITH AVERAGE FPS
(frame.shape[1], frame.shape[0]),
)