From 546d8a0ab765edaff8b6068b0bdb54f48a10734e Mon Sep 17 00:00:00 2001 From: YadiraF Date: Wed, 18 Jul 2018 19:32:41 +0800 Subject: [PATCH] change scale size 200 to 180 --- examples/1_pipeline.py | 4 ++-- examples/2_3dmm.py | 2 +- examples/4_light.py | 4 ++-- examples/5_render.py | 2 +- examples/6_generate_image_map.py | 2 +- examples/7_generate_uv_map.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/1_pipeline.py b/examples/1_pipeline.py index 2593b51..03f71fc 100644 --- a/examples/1_pipeline.py +++ b/examples/1_pipeline.py @@ -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] diff --git a/examples/2_3dmm.py b/examples/2_3dmm.py index 9616be2..e0be9bb 100644 --- a/examples/2_3dmm.py +++ b/examples/2_3dmm.py @@ -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) diff --git a/examples/4_light.py b/examples/4_light.py index eaf4887..e05d1c9 100644 --- a/examples/4_light.py +++ b/examples/4_light.py @@ -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) diff --git a/examples/5_render.py b/examples/5_render.py index 88cbf1e..e45bfce 100644 --- a/examples/5_render.py +++ b/examples/5_render.py @@ -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) diff --git a/examples/6_generate_image_map.py b/examples/6_generate_image_map.py index 7ff7aa5..d076635 100644 --- a/examples/6_generate_image_map.py +++ b/examples/6_generate_image_map.py @@ -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] diff --git a/examples/7_generate_uv_map.py b/examples/7_generate_uv_map.py index 244d892..e048c8e 100644 --- a/examples/7_generate_uv_map.py +++ b/examples/7_generate_uv_map.py @@ -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)