update
Browse files- infer_api.py +7 -1
- refine/mesh_refine.py +1 -2
infer_api.py
CHANGED
@@ -642,7 +642,13 @@ def infer_refine(meshes, imgs):
|
|
642 |
mesh_v = torch.tensor(mesh_v, dtype=torch.float32)
|
643 |
mesh_f = torch.tensor(mesh_f)
|
644 |
|
645 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
646 |
|
647 |
# my mesh flow weight by nearest vertexs
|
648 |
try:
|
|
|
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
|
654 |
try:
|
refine/mesh_refine.py
CHANGED
@@ -266,6 +266,7 @@ def run_mesh_refine(vertices, faces, pils: List[Image.Image], fixed_v=None, fixe
|
|
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)
|
@@ -278,7 +279,6 @@ def geo_refine(mesh_v, mesh_f, rgb_ls, normal_ls, expansion_weight=0.1, fixed_v=
|
|
278 |
vertices, faces = geo_refine_2(vertices, faces, fixed_v=fixed_v)
|
279 |
return geo_refine_3(vertices, faces, rgb_ls, fixed_v=fixed_v, fixed_f=fixed_f, distract_mask=distract_mask)
|
280 |
|
281 |
-
@spaces.GPU()
|
282 |
def geo_refine_1(mesh_v, mesh_f, rgb_ls, normal_ls, expansion_weight=0.1, fixed_v=None, fixed_f=None,
|
283 |
distract_mask=None, distract_bbox=None, thres=3e-6, no_decompose=False):
|
284 |
|
@@ -318,7 +318,6 @@ def geo_refine_2(vertices, faces, fixed_v=None):
|
|
318 |
vertices, faces = trimesh.remesh.subdivide(vertices, faces)
|
319 |
return vertices, faces
|
320 |
|
321 |
-
@spaces.GPU()
|
322 |
def geo_refine_3(vertices, faces, rgb_ls, fixed_v=None, fixed_f=None, distract_mask=None):
|
323 |
origin_len_v, origin_len_f = len(vertices), len(faces)
|
324 |
# concatenate fixed_v and fixed_f
|
|
|
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)
|
|
|
279 |
vertices, faces = geo_refine_2(vertices, faces, fixed_v=fixed_v)
|
280 |
return geo_refine_3(vertices, faces, rgb_ls, fixed_v=fixed_v, fixed_f=fixed_f, distract_mask=distract_mask)
|
281 |
|
|
|
282 |
def geo_refine_1(mesh_v, mesh_f, rgb_ls, normal_ls, expansion_weight=0.1, fixed_v=None, fixed_f=None,
|
283 |
distract_mask=None, distract_bbox=None, thres=3e-6, no_decompose=False):
|
284 |
|
|
|
318 |
vertices, faces = trimesh.remesh.subdivide(vertices, faces)
|
319 |
return vertices, faces
|
320 |
|
|
|
321 |
def geo_refine_3(vertices, faces, rgb_ls, fixed_v=None, fixed_f=None, distract_mask=None):
|
322 |
origin_len_v, origin_len_f = len(vertices), len(faces)
|
323 |
# concatenate fixed_v and fixed_f
|