TRELLIS.2 部署全指南:从环境配置到多视角生成3D模型的踩坑与实战

TRELLIS.2 部署全指南:从环境配置到多视角生成3D模型的踩坑与实战 目录多视角生成3d模型思路TRELLIS.2生成glb如果是人物/角色多视角生成3d模型思路多视角图片↓MASt3R↓Mesh↓TRELLIS.2 TextureTRELLIS.2pip install atomgit atomgit download hf_mirrors/briaai/RMBG-2.0 -d ./pip install -U triton3.2.0import os os.environ[PYTORCH_CUDA_ALLOC_CONF] expandable_segments:True # Can save GPU memory import trimesh from PIL import Image from trellis2.pipelines import Trellis2TexturingPipeline # 1. Load Pipeline pipeline Trellis2TexturingPipeline.from_pretrained(/data/feature/lbg/models/microsoft_TRELLIS.2-4B, config_filetexturing_pipeline.json) pipeline.cuda() # 2. Load Mesh, image Run mesh trimesh.load(assets/example_texturing/the_forgotten_knight.ply) image Image.open(assets/example_texturing/image.webp) output pipeline.run(mesh, image) # 3. Render Mesh output.export(textured.glb, extension_webpTrue)生成glbo_voxel库glb o_voxel.postprocess.to_glb( vertices mesh.vertices, faces mesh.faces, attr_volume mesh.attrs, coords mesh.coords, attr_layout mesh.layout, voxel_size mesh.voxel_size, aabb [[-0.5, -0.5, -0.5], [0.5, 0.5, 0.5]], decimation_target 1000000, texture_size 4096, remesh True, remesh_band 1, remesh_project 0, verbose True ) glb.export(sample.glb, extension_webpTrue)如果是人物/角色推荐多视角人物照片 ↓ Human Gaussian 或 InstantAvatar 或 WonderHuman