Skip to content

Instantly share code, notes, and snippets.

View mdda's full-sized avatar

Martin Andrews mdda

View GitHub Profile
@zalo
zalo / 3DHeadOrientation.py
Last active August 16, 2022 06:30
This is an example using Adrian Bulat's face_alignment library and Python to draw the head's basis vectors
import numpy as np
import cv2
import face_alignment
# Initialize the face alignment tracker
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=True, device="cuda")
# Start the webcam capture, exit with 'q'
cap = cv2.VideoCapture(0)
while(not (cv2.waitKey(1) & 0xFF == ord('q'))):