YulianSa commited on
Commit
4b04e0b
·
1 Parent(s): 01416ea
Files changed (2) hide show
  1. app.py +3 -3
  2. slrm/utils/mesh_util.py +2 -1
app.py CHANGED
@@ -129,8 +129,8 @@ def multiview_to_mesh(images, image_hash):
129
  print(f'loaded cached slrm files: {image_hash}')
130
  return *mesh_files, image_hash
131
 
132
- def refine_mesh(apose_img, mesh1, mesh2, mesh3, seed, image_hash):
133
- apose_img = Image.fromarray(apose_img)
134
  if image_hash not in cache_refine:
135
  results = infer_api.genStage2(apose_img, seed, num_levels=2)
136
  results[0] = {}
@@ -224,7 +224,7 @@ with gr.Blocks(title="StdGEN: Semantically Decomposed 3D Character Generation fr
224
 
225
  refine_btn.click(
226
  refine_mesh,
227
- inputs=[a_pose_image, *mesh_cols, seed_input2, state3],
228
  outputs=[refined_meshes[2], refined_meshes[0], refined_meshes[1], refined_full_mesh]
229
  )
230
 
 
129
  print(f'loaded cached slrm files: {image_hash}')
130
  return *mesh_files, image_hash
131
 
132
+ def refine_mesh(mesh1, mesh2, mesh3, seed, image_hash):
133
+ apose_img = Image.open(cache_multiview[0][image_hash]["images"][0])
134
  if image_hash not in cache_refine:
135
  results = infer_api.genStage2(apose_img, seed, num_levels=2)
136
  results[0] = {}
 
224
 
225
  refine_btn.click(
226
  refine_mesh,
227
+ inputs=[*mesh_cols, seed_input2, state3],
228
  outputs=[refined_meshes[2], refined_meshes[0], refined_meshes[1], refined_full_mesh]
229
  )
230
 
slrm/utils/mesh_util.py CHANGED
@@ -18,7 +18,8 @@ from PIL import Image
18
  def save_obj(pointnp_px3, facenp_fx3, colornp_px3, fpath):
19
 
20
  pointnp_px3 = pointnp_px3 @ np.array([[1, 0, 0], [0, 1, 0], [0, 0, -1]])
21
- facenp_fx3 = facenp_fx3[:, [2, 1, 0]]
 
22
 
23
  mesh = trimesh.Trimesh(
24
  vertices=pointnp_px3,
 
18
  def save_obj(pointnp_px3, facenp_fx3, colornp_px3, fpath):
19
 
20
  pointnp_px3 = pointnp_px3 @ np.array([[1, 0, 0], [0, 1, 0], [0, 0, -1]])
21
+ # facenp_fx3 = facenp_fx3[:, [2, 1, 0]]
22
+ pointnp_px3[:, 0] *= -1.
23
 
24
  mesh = trimesh.Trimesh(
25
  vertices=pointnp_px3,