Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeng95 committed Jul 19, 2018
1 parent fd08f04 commit 4d6ba8c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 1 deletion.
Binary file modified examples/results/3dmm/fitted.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/results/3dmm/generated.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/results/posmap_300WLP/IBUG_image_008_1_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/results/posmap_300WLP/IBUG_image_008_1_0_posmap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion face3d/mesh/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def similarity_transform(vertices, s, R, t3d):


## -------------- Camera. from world space to camera space
# Ref: https://cs184.eecs.berkeley.edu/lecture/transforms-2
def normalize(x):
epsilon = 1e-12
norm = np.sqrt(np.sum(x**2, axis = 0))
Expand Down Expand Up @@ -198,7 +199,7 @@ def perspective_project(vertices, fovy, aspect_ratio = 1., near = 0.1, far = 100
def to_image(vertices, h, w, is_perspective = False):
''' change vertices to image coord system
3d system: XYZ, center(0, 0, 0)
2d image: X(w), Y(h). center(w/2, h/2), flip Y(h).
2d image: x(u), y(v). center(w/2, h/2), flip y-axis.
'''
image_vertices = vertices.copy()
if is_perspective:
Expand Down

0 comments on commit 4d6ba8c

Please sign in to comment.