Skip to content

Instantly share code, notes, and snippets.

View RSKothari's full-sized avatar

Rakshit Kothari RSKothari

View GitHub Profile
@zalo
zalo / 3DHeadOrientation.py
Last active November 26, 2024 10:43
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'))):