Spaces:
Build error
Build error
Commit ·
3057b36
1
Parent(s): 4a3087a
Update
Browse filesFiles changed (2)
123418 unmodified lines23242526272815 unmodified lines444546474849import gradio as gr# from gradio_litmodel3d import LitModel3Dimport os18 unmodified linesreturn pipeline.preprocess_image(image)def image_to_3d(image: Image.Image) -> Tuple[dict, str]:"""Convert an image to a 3D model.15 unmodified linesreturn model, video_pathdef extract_glb(model: dict, mesh_simplify: float, texture_size: int) -> Tuple[str, str]:"""Extract a GLB file from the 3D model.1234518 unmodified lines2425262728293015 unmodified lines46474849505152import gradio as grimport spaces# from gradio_litmodel3d import LitModel3Dimport os18 unmodified linesreturn pipeline.preprocess_image(image)@spaces.GPUdef image_to_3d(image: Image.Image) -> Tuple[dict, str]:"""Convert an image to a 3D model.15 unmodified linesreturn model, video_path@spaces.GPUdef extract_glb(model: dict, mesh_simplify: float, texture_size: int) -> Tuple[str, str]:"""Extract a GLB file from the 3D model.
101 unmodified lines10210310410510610710810943 unmodified lines153154155156157158159160161101 unmodified lines)self.resolution = resolutionself.rep_config = representation_configmesh_extractor = SparseFeatures2Mesh('cpu', res=self.resolution*4, use_color=self.rep_config.get('use_color', False))self.out_channels = mesh_extractor.feats_channelsself.upsample = nn.ModuleList([SparseSubdivideBlock3d(channels=model_channels,43 unmodified lineslist of representations"""ret = []mesh_extractor = SparseFeatures2Mesh(x.device, res=self.resolution*4, use_color=self.rep_config.get('use_color', False))for i in range(x.shape[0]):mesh = mesh_extractor(x[i], training=self.training)ret.append(mesh)return ret101 unmodified lines10210310410510610710810943 unmodified lines153154155156157158159160101 unmodified lines)self.resolution = resolutionself.rep_config = representation_configself.mesh_extractor = SparseFeatures2Mesh(res=self.resolution*4, use_color=self.rep_config.get('use_color', False))self.out_channels = self.mesh_extractor.feats_channelsself.upsample = nn.ModuleList([SparseSubdivideBlock3d(channels=model_channels,43 unmodified lineslist of representations"""ret = []for i in range(x.shape[0]):mesh = self.mesh_extractor(x[i], training=self.training)ret.append(mesh)return ret
app.py+3
trellis/models/structured_latent_vae/decoder_mesh.py+3-4