Spaces:
Build error
Build error
tokenid commited on
Commit ·
35f429b
1
Parent(s): 00059bc
update
Browse filesFiles changed (2)
166 unmodified lines16716816917017117217317417517617717817918018118218318418518618718818919019119219319419519656 unmodified lines253254255256257258259166 unmodified linesreturn z123_image, show_imagedef make_mesh(mesh_fpath, planes):mesh_basename = os.path.basename(mesh_fpath).split('.')[0]mesh_dirname = os.path.dirname(mesh_fpath)mesh_vis_fpath = os.path.join(mesh_dirname, f"{mesh_basename}.glb")with torch.no_grad():# get meshmesh_out = model.extract_mesh(planes,use_texture_map=False,**infer_config,)vertices, faces, vertex_colors = mesh_outvertices = vertices[:, [0, 2, 1]]vertices[:, -1] *= -1save_obj(vertices, faces, vertex_colors, mesh_fpath)print(f"Mesh saved to {mesh_fpath}")return mesh_fpath@spaces.GPUdef make3d(input_image, sample_steps, sample_seed):56 unmodified lines# print(f"Video saved to {video_fpath}")mesh_fpath = make_mesh(mesh_fpath, planes)return mesh_fpath, show_images166 unmodified lines16716816917017117256 unmodified lines229230231232233234235236237238239240241242243244245246247248166 unmodified linesreturn z123_image, show_image@spaces.GPUdef make3d(input_image, sample_steps, sample_seed):56 unmodified lines# print(f"Video saved to {video_fpath}")# get meshmesh_out = model.extract_mesh(planes,use_texture_map=False,**infer_config,)vertices, faces, vertex_colors = mesh_outvertices = vertices[:, [0, 2, 1]]vertices[:, -1] *= -1save_obj(vertices, faces, vertex_colors, mesh_fpath)print(f"Mesh saved to {mesh_fpath}")return mesh_fpath, show_images
67 unmodified lines68697071727367 unmodified linescoordinates = (2/box_warp) * coordinates # add specific box boundsprojected_coordinates = project_onto_planes(plane_axes, coordinates).unsqueeze(1)output_features = torch.nn.functional.grid_sample(plane_features,67 unmodified lines686970717273747567 unmodified linescoordinates = (2/box_warp) * coordinates # add specific box boundsprint('plane_axes', plane_axes.dtype, 'plane_features', plane_features.dtype, 'coordinates', coordinates.dtype)projected_coordinates = project_onto_planes(plane_axes, coordinates).unsqueeze(1)output_features = torch.nn.functional.grid_sample(plane_features,
app.py+14-25
src/models/renderer/utils/renderer.py+2