Colin97 / MSN-Point-Cloud-Completion

Morphing and Sampling Network for Dense Point Cloud Completion (AAAI2020)
Apache License 2.0
417 stars 57 forks source link

Number of points in EMD function #4

Closed ziruiw-dev closed 4 years ago

ziruiw-dev commented 4 years ago

Hi @Colin97,

Thanks for the great work and releasing the code.

I am using the EMD function and I found that it requires the number of input points to be divisible by 1024

class emdFunction(Function):
    @staticmethod
    def forward(ctx, xyz1, xyz2, eps, iters):

        batchsize, n, _ = xyz1.size()
        _, m, _ = xyz2.size()

        assert(n == m)
        assert(xyz1.size()[0] == xyz2.size()[0])
        assert(n % 1024 == 0)
        assert(batchsize <= 512)

https://github.com/Colin97/MSN-Point-Cloud-Completion/blob/c5f23a91d343f6a76d07f04a589d0294d456a293/emd/emd_module.py#L40

I am trying to compute the EMD distance between two point clouds contain 20 points each so I wonder can I remove this assert safely? or is there an easy way to modify the code for a 20-point point cloud?

Best, Zirui

Colin97 commented 4 years ago

Sorry, I think the CUDA code doesn't take that case into account.

ziruiw-dev commented 4 years ago

Thanks a lot for your reply. Best, Zirui