Yuliang commited on
Commit
8a246ed
1 Parent(s): b0f2345

delete texture colors

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. apps/infer.py +14 -9
app.py CHANGED
@@ -46,7 +46,7 @@ description = '''
46
  </th>
47
  </table>
48
 
49
- #### The reconstruction + refinement + video take about 80~120 seconds for single image.
50
 
51
  <details>
52
 
 
46
  </th>
47
  </table>
48
 
49
+ #### The reconstruction + refinement + video take about 80~200 seconds for single image.
50
 
51
  <details>
52
 
apps/infer.py CHANGED
@@ -50,10 +50,9 @@ def generate_model(in_path, model_type):
50
 
51
  torch.cuda.empty_cache()
52
 
53
- config_dict = {'loop_smpl': 50,
54
- 'loop_cloth': 100,
55
  'patience': 5,
56
- 'vis_freq': 10,
57
  'out_dir': './results',
58
  'hps_type': 'pymaf',
59
  'config': f"./configs/{model_type}.yaml"}
@@ -414,12 +413,17 @@ def generate_model(in_path, model_type):
414
  mesh_pr.faces_packed().detach().squeeze(0).cpu(),
415
  process=False, maintains_order=True
416
  )
417
- final_colors = query_color(
418
- mesh_pr.verts_packed().detach().squeeze(0).cpu(),
419
- mesh_pr.faces_packed().detach().squeeze(0).cpu(),
420
- in_tensor["image"],
421
- device=device,
422
- )
 
 
 
 
 
423
  final.visual.vertex_colors = final_colors
424
  final.export(
425
  f"{config_dict['out_dir']}/{cfg.name}/obj/{data['name']}_refine.obj")
@@ -454,6 +458,7 @@ def generate_model(in_path, model_type):
454
  for element in dir():
455
  if 'path' not in element:
456
  del locals()[element]
 
457
  torch.cuda.empty_cache()
458
 
459
  return [smpl_path, smpl_path, smpl_npy_path, recon_path, recon_path, refine_path, refine_path, video_path, overlap_path]
 
50
 
51
  torch.cuda.empty_cache()
52
 
53
+ config_dict = {'loop_smpl': 100,
54
+ 'loop_cloth': 200,
55
  'patience': 5,
 
56
  'out_dir': './results',
57
  'hps_type': 'pymaf',
58
  'config': f"./configs/{model_type}.yaml"}
 
413
  mesh_pr.faces_packed().detach().squeeze(0).cpu(),
414
  process=False, maintains_order=True
415
  )
416
+
417
+ # with front texture
418
+ # final_colors = query_color(
419
+ # mesh_pr.verts_packed().detach().squeeze(0).cpu(),
420
+ # mesh_pr.faces_packed().detach().squeeze(0).cpu(),
421
+ # in_tensor["image"],
422
+ # device=device,
423
+ # )
424
+
425
+ # without front texture
426
+ final_colors = (mesh_pr.verts_normals_padded().squeeze(0).detach().cpu() + 1.0) * 0.5 * 255.0
427
  final.visual.vertex_colors = final_colors
428
  final.export(
429
  f"{config_dict['out_dir']}/{cfg.name}/obj/{data['name']}_refine.obj")
 
458
  for element in dir():
459
  if 'path' not in element:
460
  del locals()[element]
461
+
462
  torch.cuda.empty_cache()
463
 
464
  return [smpl_path, smpl_path, smpl_npy_path, recon_path, recon_path, refine_path, refine_path, video_path, overlap_path]