Skip to content

Commit

Permalink
modify comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeng95 committed Jul 19, 2018
1 parent 61de91a commit 0c05993
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions face3d/morphable_model/fit.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'''
Estimating parameters about vertices: shape para, exp para
Estimating parameters about vertices: shape para, exp para, pose para(s, R, t)
'''
import numpy as np
from .. import mesh


''' TODO: a clear document.
Given: image_points, 3D Model, Camera Matrix(s, R, t2d)
Estimate: shape parameters, expression parameters
Expand Down Expand Up @@ -83,7 +82,7 @@ def estimate_shape(x, shapeMU, shapePC, shapeEV, expression, s, R, t2d, lamb = 3

# --- calc pc
pc_3d = np.resize(shapePC.T, [dof, n, 3]) # 199 x n x 3
pc_3d = np.reshape(pc_3d, [dof*n, 3]) ## !it still works without this line, but Adding this will let the next line run faster than without reshape, I don't know why. ##ToDo: learn more about numpy dot mul
pc_3d = np.reshape(pc_3d, [dof*n, 3])
pc_2d = pc_3d.dot(A.T.copy()) # 199 x n x 2

pc = np.reshape(pc_2d, [dof, -1]).T # 2n x 199
Expand Down Expand Up @@ -212,7 +211,7 @@ def fit_points(x, X_ind, model, n_sp, n_ep, max_iter = 4):
return sp, ep, s, R, t


# ---------------- fit
# ---------------- fitting process
def fit_points_for_show(x, X_ind, model, n_sp, n_ep, max_iter = 4):
'''
Args:
Expand Down
3 changes: 2 additions & 1 deletion face3d/morphable_model/morphabel_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def generate_colors(self, tex_para):
return colors


# ------------------------------------------- transform
# ------------------------------------------- transformation
# ------------- transform
def rotate(self, vertices, angles):
''' rotate face
Expand All @@ -116,6 +116,7 @@ def transform(self, vertices, s, angles, t3d):
def transform_3ddfa(self, vertices, s, angles, t3d): # only used for processing 300W_LP data
R = mesh.transform.angle2matrix_3ddfa(angles)
return mesh.transform.similarity_transform(vertices, s, R, t3d)

# --------------------------------------------------- fitting
def fit(self, x, X_ind, max_iter = 4, isShow = False):
''' fit 3dmm & pose parameters
Expand Down

0 comments on commit 0c05993

Please sign in to comment.