Skip to content

Commit

Permalink
change scale size 200 to 180
Browse files Browse the repository at this point in the history
  • Loading branch information
yfeng95 committed Jul 18, 2018
1 parent 0d365c0 commit 546d8a0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/1_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
colors = colors/np.max(colors)

# ------------------------------ 2. modify vertices(transformation. change position of obj)
# scale. target size=200 for example
s = 200/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
# scale. target size=180 for example
s = 180/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
# rotate 30 degree for example
R = mesh.transform.angle2matrix([0, 30, 0])
# no translation. center of obj:[0,0]
Expand Down
2 changes: 1 addition & 1 deletion examples/2_3dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
colors = np.minimum(np.maximum(colors, 0), 1)

# --- 3. transform vertices to proper position
s = 1e-03
s = 8e-04
angles = [10, 30, 20]
t = [0, 0, 0]
transformed_vertices = bfm.transform(vertices, s, angles, t)
Expand Down
4 changes: 2 additions & 2 deletions examples/4_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def light_test(vertices, light_positions, light_intensities, h = 256, w = 256):
colors = colors/np.max(colors)
# move center to [0,0,0]
vertices = vertices - np.mean(vertices, 0)[np.newaxis, :]
s = 200/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
s = 180/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
R = mesh.transform.angle2matrix([0, 0, 0])
t = [0, 0, 0]
vertices = mesh.transform.similarity_transform(vertices, s, R, t)


# save settings
save_folder = 'results/light'
if not os.path.exists(save_folder):
os.mkdir(save_folder)
Expand Down
2 changes: 1 addition & 1 deletion examples/5_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
colors = colors/np.max(colors)
# move center to [0,0,0]
vertices = vertices - np.mean(vertices, 0)[np.newaxis, :]
s = 200/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
s = 180/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
R = mesh.transform.angle2matrix([0, 0, 0])
t = [0, 0, 0]
vertices = mesh.transform.similarity_transform(vertices, s, R, t)
Expand Down
2 changes: 1 addition & 1 deletion examples/6_generate_image_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# ------------------------------ modify vertices(transformation. change position of obj)
# scale. target size=200 for example
s = 200/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
s = 180/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
# rotate 30 degree for example
R = mesh.transform.angle2matrix([0, 30, 0])
# no translation. center of obj:[0,0]
Expand Down
2 changes: 1 addition & 1 deletion examples/7_generate_uv_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def process_uv(uv_coords, uv_h = 256, uv_w = 256):
vertices = C['vertices']; colors = C['colors']; triangles = C['full_triangles'];
colors = colors/np.max(colors)
# --modify vertices(transformation. change position of obj)
s = 200/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
s = 180/(np.max(vertices[:,1]) - np.min(vertices[:,1]))
R = mesh.transform.angle2matrix([0, 30, 0])
t = [0, 0, 0]
transformed_vertices = mesh.transform.similarity_transform(vertices, s, R, t)
Expand Down

0 comments on commit 546d8a0

Please sign in to comment.