目录
psbody加载
psbody示例
trimesh加载
openmesh
psbody加载
codetalker
from psbody.mesh import Meshif cfg.dataset == "BIWI":template_file = os.path.join(cfg.data_root, "BIWI.ply")elif cfg.dataset == "vocaset":template_file = os.path.join(cfg.data_root, "FLAME_sample.ply")print("rendering: ", test_name)template = Mesh(filename=template_file)
psbody示例
from psbody.mesh import Mesh
from psbody.mesh.meshviewer import MeshViewertemplate_file = r'BIWI/BIWI.ply'
template_file = r'E:\project\audio\audio2face\CodeTalker-main\vocaset\FLAME_sample.ply'
# template_file = r'E:\project\audio\audio2face\CodeTalker-main\BIWI\BIWI.ply'target_mesh = Mesh(filename=template_file)
target_mesh.set_vertex_colors('white')
viewer = MeshViewer()
# viewer.set_background_color((1.0, 1.0, 1.0),blocking=False)viewer.set_static_meshes([target_mesh], blocking=True)
# viewer.set_dynamic_meshes(target_mesh)
viewer.set_background_color((1.0, 1.0, 1.0))
viewer.show()
这个显示是黑屏,不能显示物体
trimesh加载
FaceDiffuser
import trimeshif __name__ == '__main__':template_file=f"data/BIWI/templates/face_template.obj"ref_mesh = trimesh.load_mesh(template_file, process=False)scene = trimesh.scene.scene.Scene([ref_mesh])# 显示场景scene.show()
报错:
ImportError: `trimesh.viewer.windowed` requires `pip install "pyglet<2"`
解决方法:
pip install "pyglet<2"
openmesh
pip install openmesh
win11直接安装报错
从巴塞尔面模型 (BFM) 转换为 FLAME 头部模型
https://github.com/TimoBolkart/BFM_to_FLAME