Yuliang commited on
Commit
f5e8b77
1 Parent(s): daafd12

add normal as color for better obbj visualization

Browse files
Files changed (1) hide show
  1. apps/infer.py +2 -0
apps/infer.py CHANGED
@@ -295,6 +295,7 @@ def generate_model(in_path, model_type):
295
  process=False,
296
  maintains_order=True
297
  )
 
298
  smpl_obj.export(
299
  f"{config_dict['out_dir']}/{cfg.name}/obj/{data['name']}_smpl.obj")
300
 
@@ -334,6 +335,7 @@ def generate_model(in_path, model_type):
334
  recon_obj = trimesh.Trimesh(
335
  verts_pr, faces_pr, process=False, maintains_order=True
336
  )
 
337
  recon_obj.export(
338
  os.path.join(config_dict['out_dir'], cfg.name,
339
  f"obj/{data['name']}_recon.obj")
 
295
  process=False,
296
  maintains_order=True
297
  )
298
+ smpl_obj.visual.vertex_colors = (smpl_obj.vertex_normals+1.0)*255.0*0.5
299
  smpl_obj.export(
300
  f"{config_dict['out_dir']}/{cfg.name}/obj/{data['name']}_smpl.obj")
301
 
 
335
  recon_obj = trimesh.Trimesh(
336
  verts_pr, faces_pr, process=False, maintains_order=True
337
  )
338
+ recon_obj.visual.vertex_colors = (recon_obj.vertex_normals+1.0)*255.0*0.5
339
  recon_obj.export(
340
  os.path.join(config_dict['out_dir'], cfg.name,
341
  f"obj/{data['name']}_recon.obj")