buaacyw / MeshAnythingV2

From anything to mesh like human artists. Official impl. of "MeshAnything V2: Artist-Created Mesh Generation With Adjacent Mesh Tokenization"
https://buaacyw.github.io/meshanything-v2/
Other
632 stars 33 forks source link

why my data test very worse? #11

Open liang00fan opened 2 months ago

liang00fan commented 2 months ago

https://free3d.com/zh/3d-model/bmw850-12027.html is my test obj file. i convert it into npy first, then put the frog.npy into pc_examples and run with follow commands:

python main.py --input_dir pc_examples --out_dir pc_output --input_type pc_normal

here is my code to convert obj to npy.

import trimesh
import numpy as np

from utils import mesh_utils

# 读取 .ply 文件
ply_path = r"D:\work\datasets\animal_objs\BMW850\BMW850.obj"  # 请将这里替换为你的 .ply 文件路径
mesh = mesh_utils.load_mesh(ply_path)

# 获取点云中的点坐标和法向量
points = mesh.vertices  # xyz 坐标
normals = mesh.vertex_normals  # 法向量

l2_norms = np.linalg.norm(normals, axis=1, keepdims=True) + 1e-7
normalized_array = normals / l2_norms
mask = np.linalg.norm(normalized_array, axis=-1) > 0.99
normals_array = normalized_array[mask]
points_array = points[mask]
# 将 xyz 和法向量组合
data = np.hstack((points_array, normals_array))

# 保存为 .npy 文件
npy_path = "BMW850.npy"  # 你想要保存的文件名和路径
np.save(npy_path, data)

print(f"点云数据和法向量已成功保存为 {npy_path} 文件!")
Mrguanglei commented 1 week ago

@liang00fan Hi, do you have the training code? Can you share it