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
Built Distribution
File details
Details for the file headpose-1.1.8.tar.gz
.
File metadata
- Download URL: headpose-1.1.8.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47619e88a6ad6d55cd967f63544b940d860e21a2154233118697babecb2a355 |
|
MD5 | 2e8066a0bf74494ce06f61c7c19fa616 |
|
BLAKE2b-256 | 53c4d50d76b8b71d9842ed8cb4af9237f4a73a2a442e49428f171efe6db00da4 |
File details
Details for the file headpose-1.1.8-py3-none-any.whl
.
File metadata
- Download URL: headpose-1.1.8-py3-none-any.whl
- Upload date:
- Size: 145.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68859c9557f4b647ead2651ee7fb66e99c71e5c7b2177dd904be790a73032304 |
|
MD5 | 3c262b117e69b7908ad85ee867538206 |
|
BLAKE2b-256 | f33689bd1b515a81a046825a424ce5c4f5e1408a86269472b798645d33c10115 |