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.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

headpose-1.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file headpose-1.1.0.tar.gz.

File metadata

  • Download URL: headpose-1.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for headpose-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b19404f58a808bdcb7e99cf4c7a420952c22dfca16a8676616a5d4d057fce2c1
MD5 f0b194ca78733b4365624c56cd06e8bf
BLAKE2b-256 88d0113b8ec6cbb77d2d62983516706c1ac822b3c1f898c58856ee87db94b358

See more details on using hashes here.

File details

Details for the file headpose-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: headpose-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for headpose-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 965d6d1f3500c85f7a0336329c4101062e297a37c84d52bb1a07ac05e93f63ec
MD5 9021b3e5858c7c92b9086e1f7fee5a71
BLAKE2b-256 b606c0073d85aaabb6b5218c08cfc9761e92b213369baa9cce981fdf015d2d74

See more details on using hashes here.

Supported by

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