czq142857 / NMC

PyTorch implementation for paper Neural Marching Cubes.
MIT License
157 stars 17 forks source link

How can I only use eval_cd_nc_f1_ecd_ef1.py? #8

Open WildEchoes opened 1 year ago

WildEchoes commented 1 year ago

Thanks for your excellent work! If I only want to use eval_cd_nc_f1_ecd_ef1.py to evaluate my mesh data, what must I prepare?

czq142857 commented 1 year ago

You only need to prepare a folder containing your output meshes and another folder containing the ground truth meshes.

The meshes should be normalized in the same way. For example, in NMC, the output meshes have a different size compared to the ground truth shapes. Therefore, in line 70 of eval_cd_nc_f1_ecd_ef1.py, you can find pred_points = pred_points/64-0.5 to normalize the shape (sampled points) of the output meshes.

You can read the code in eval_cd_nc_f1_ecd_ef1.py to have a better understanding of how it works.

WildEchoes commented 1 year ago

You only need to prepare a folder containing your output meshes and another folder containing the ground truth meshes.

The meshes should be normalized in the same way. For example, in NMC, the output meshes have a different size compared to the ground truth shapes. Therefore, in line 70 of _eval_cd_nc_f1_ecdef1.py, you can find pred_points = pred_points/64-0.5 to normalize the shape (sampled points) of the output meshes.

You can read the code in _eval_cd_nc_f1_ecdef1.py to have a better understanding of how it works.

Thanks for your help!

WildEchoes commented 1 year ago

I have another question about normalization. Why pre_points has been normalized but gt_points not been normalized? And what does dividing by 64 mean?

czq142857 commented 1 year ago

It is because pred_points is sampled from the predicted mesh, which has not been normalized yet. So these points need to be normalized by dividing 64. 64 is the output resolution of the mesh (scale=64), which is also the scale of the mesh with respect to a normalized mesh (scale=1). gt_points has already been normalized because they are sampled from a normalized ground truth mesh.