lucidrains / meshgpt-pytorch

Implementation of MeshGPT, SOTA Mesh generation using Attention, in Pytorch
MIT License
700 stars 57 forks source link

Continuous range for discretize area #91

Open sbriseid opened 2 months ago

sbriseid commented 2 months ago

Hi @lucidrains and @MarcusLoppe!

It seems that the area discretizer has an inefficient bin usage for the triangle mesh, using only the first half: self.discretize_area = partial(discretize, num_discrete = num_discrete_area, continuous_range = (0., (hi - lo) ** 2))

This is correct for quad meshes, but for triangles there should be a 0.5 factor for the upper limit: continuous_range = (0., (hi - lo) ** 2) if quads else (0., 0.5 * (hi - lo) ** 2

lucidrains commented 2 months ago

@sbriseid I don't think that extra scale matters for the network, but yes, technically incorrect area for triangle

sbriseid commented 2 months ago

I agree, the scaling should not matter. I was thinking that increasing from the available 64 to the full 128 bins, which allows for improved separation between triangles of almost equal area, could be of some value. But it is far from the level of the fix that addressed the issue where all triangles had area 0.5.