Skip to main content

estimate the pose of the head based on an image.

Project description

Purpose

This package offers classes and methods for pose estimation on images. This can be done either with deep learning based facial landmark detection or by detecting ArUco markers.

Installation

Get the latest published version: pip install headpose
or install directly from GitHub: pip install git+https://github.com/OleBialas/headpose.git To use landmark detection you additionally have to install pytorch and torchvision

Example

import cv2
from headpose.detect import PoseEstimator

est = PoseEstimator()  #load the model
# take an image using the webcam (alternatively, you could load an image)
cam = cv2.VideoCapture(0)
for i in range(cv2.CAP_PROP_FRAME_COUNT):
    cam.grab()
ret, image = cam.retrieve()
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cam.release()

est.detect_landmarks(image, plot=True)  # plot the result of landmark detection
roll, pitch, yawn = est.pose_from_image(image)  # estimate the head pose

Sources & Further Reading

This blog post nicely explained the concepts and mathematics behind pose estimation and this tutorial walks through the single steps of detecting facial landmarks with pytorch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

headpose-1.1.8.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

headpose-1.1.8-py3-none-any.whl (145.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page