YulianSa commited on
Commit
fdc86f3
·
1 Parent(s): 76fcd25
Files changed (2) hide show
  1. infer_api.py +2 -8
  2. refine/mesh_refine.py +0 -1
infer_api.py CHANGED
@@ -554,7 +554,7 @@ def get_distract_mask(generator, color_0, color_1, normal_0=None, normal_1=None,
554
  # )
555
  infer_refine_outside_ratio = 0.20
556
 
557
-
558
  def infer_refine(meshes, imgs):
559
  fixed_v, fixed_f, fixed_t = None, None, None
560
  flow_vert, flow_vector = None, None
@@ -572,7 +572,7 @@ def infer_refine(meshes, imgs):
572
  mesh_v, mesh_f = mesh.vertices, mesh.faces
573
 
574
  if last_colors is None:
575
- @spaces.GPU()
576
  def get_mask():
577
  mv, proj = make_star_cameras_orthographic(8, 1, r=1.2)
578
  mv = mv[[4, 3, 2, 0, 6, 5]]
@@ -642,12 +642,6 @@ def infer_refine(meshes, imgs):
642
  mesh_v = torch.tensor(mesh_v, dtype=torch.float32)
643
  mesh_f = torch.tensor(mesh_f)
644
 
645
- print("???", mesh_v.device, mesh_f.device)
646
- if fixed_v is not None:
647
- print('???" fixed_v', fixed_v.shape, fixed_v.device)
648
- if fixed_f is not None:
649
- print('???" fixed_f', fixed_f.shape, fixed_f.device)
650
-
651
  new_mesh, simp_v, simp_f = geo_refine(mesh_v, mesh_f, colors, normals, fixed_v=fixed_v, fixed_f=fixed_f)
652
 
653
  # my mesh flow weight by nearest vertexs
 
554
  # )
555
  infer_refine_outside_ratio = 0.20
556
 
557
+ @spaces.GPU()
558
  def infer_refine(meshes, imgs):
559
  fixed_v, fixed_f, fixed_t = None, None, None
560
  flow_vert, flow_vector = None, None
 
572
  mesh_v, mesh_f = mesh.vertices, mesh.faces
573
 
574
  if last_colors is None:
575
+ # @spaces.GPU()
576
  def get_mask():
577
  mv, proj = make_star_cameras_orthographic(8, 1, r=1.2)
578
  mv = mv[[4, 3, 2, 0, 6, 5]]
 
642
  mesh_v = torch.tensor(mesh_v, dtype=torch.float32)
643
  mesh_f = torch.tensor(mesh_f)
644
 
 
 
 
 
 
 
645
  new_mesh, simp_v, simp_f = geo_refine(mesh_v, mesh_f, colors, normals, fixed_v=fixed_v, fixed_f=fixed_f)
646
 
647
  # my mesh flow weight by nearest vertexs
refine/mesh_refine.py CHANGED
@@ -266,7 +266,6 @@ def run_mesh_refine(vertices, faces, pils: List[Image.Image], fixed_v=None, fixe
266
  return vertices, faces
267
 
268
 
269
- @spaces.GPU()
270
  def geo_refine(mesh_v, mesh_f, rgb_ls, normal_ls, expansion_weight=0.1, fixed_v=None, fixed_f=None,
271
  distract_mask=None, distract_bbox=None, thres=3e-6, no_decompose=False):
272
  print(mesh_v.device, mesh_f.device)
 
266
  return vertices, faces
267
 
268
 
 
269
  def geo_refine(mesh_v, mesh_f, rgb_ls, normal_ls, expansion_weight=0.1, fixed_v=None, fixed_f=None,
270
  distract_mask=None, distract_bbox=None, thres=3e-6, no_decompose=False):
271
  print(mesh_v.device, mesh_f.device)