Git Product home page Git Product logo

Comments (2)

Tetsujinfr avatar Tetsujinfr commented on August 14, 2024

Ok so I guess this is
self._get_camera_matrix = partial(self._interpreter.get_tensor,
output_details[0]["index"])

in BaseTFLiteFaceAlignment ?

from dense-head-pose-estimation.

1996scarlet avatar 1996scarlet commented on August 14, 2024

Yes, we can get the camera_matrix R directly from the model output.

self._get_camera_matrix = partial(self._interpreter.get_tensor,
output_details[0]["index"])

def _postprocessing(self, M):
iM = cv2.invertAffineTransform(M)
R = self._get_camera_matrix()[0]
landmarks = self._decode_landmarks(iM)
return landmarks, R

Then, we can decompose matrix to ruler angle

def pose(frame, results, color):
landmarks, params = results
# rotate matrix
R = params[:3, :3].copy()
# decompose matrix to ruler angle
euler = rotationMatrixToEulerAngles(R)
print(f"Pitch: {euler[0]}; Yaw: {euler[1]}; Roll: {euler[2]};")
draw_projection(frame, R, landmarks, color)

from dense-head-pose-estimation.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.