nv-tlabs / XCube

[CVPR 2024 Highlight] XCube: Large-Scale 3D Generative Modeling using Sparse Voxel Hierarchies
https://research.nvidia.com/labs/toronto-ai/xcube/
Other
344 stars 20 forks source link

Evaluation script #22

Open nuneslu opened 3 months ago

nuneslu commented 3 months ago

Hi! Thanks for your great work.

I'm trying to reproduce your results, and I would like to know if you could make your evaluation script available. I have tried to use LION repo evaluation script, but I guess you had to do some adaptations on how they compute their metrics to be able to compute it.

xrenaa commented 3 months ago

Hi, thanks for your interest of our work. We obtain the sampling point using the following function.

import point_cloud_utils as pcu

def standardize_bbox_torch(pcl):
    mins = torch.min(pcl, dim=0)[0]
    maxs = torch.max(pcl, dim=0)[0]
    center = (mins + maxs) / 2.
    scale = torch.max(maxs - mins)
    result = ((pcl - center) / scale).float()
    result = result * 2.0 # [-1.0, 1.0]
    return result

fid, bc = pcu.sample_mesh_random(mesh.v.cpu().numpy(), mesh.f.cpu().numpy(), sample_pcs_len)
pd_xyz_sample = pcu.interpolate_barycentric_coords(mesh.f.cpu().numpy(), fid, bc, mesh.v.cpu().numpy())
pd_xyz_sample = torch.from_numpy(pd_xyz_sample).float()
pd_xyz_sample = standardize_bbox_torch(pd_xyz_sample)