torchsparse icon indicating copy to clipboard operation
torchsparse copied to clipboard

About aggregation and interpolation

Open suyunzzz opened this issue 3 years ago • 7 comments

hello, zhijian,

  1. i want to do a aggregation and interpolation in sparse voxel, there are my code:
# aggregate + upsampling
def aggregate(x:SparseTensor,  voxel_size:int):
    z = PointTensor(x.F, x.C.float())
    
    x0 = initial_voxelize(z, 1, voxel_size)          # voxelization
    
    z0 = voxel_to_point(x0, z, nearest=True)   # voxel to point

    x1 = SparseTensor(z0.F, x.C, 1)

    print(x1.C.equal(x.C))
    print(x1.F.equal(x.F))
    return x1

in x1 = SparseTensor(z0.F, x.C, 1), i use x.C and z0.F to construct output x1, did I do something wrong?

  1. in this case, the kernel == voxel_size and stride == voxel_size, could I understand in this way?

thanks a lot! : )

suyunzzz avatar Dec 13 '21 16:12 suyunzzz

Hi @suyunzzz, I don't fully understand your need (what the goal is for your operator). Could you please elaborate a bit more?

zhijian-liu avatar Dec 27 '21 18:12 zhijian-liu

Hi @suyunzzz, I don't fully understand your need (what the goal is for your operator). Could you please elaborate a bit more?

Hello, zhijian, In the MinkowskiEngine, there are some LocalPooling function, i.e. MinkowskiAvgPooling, not global_avg_pool, i want to know how to implement it(local_avg_pool) in torchsparse.

it just used to a multi-scale aggregate module ^^,like this: image

i am not sure whether i expline clearly, thanks a lot

suyunzzz avatar Dec 28 '21 04:12 suyunzzz

I haven't checked the details of your implementation, but I think you are on the right track.

From my understanding, you might need to pass x.s to reconstruct the sparse tensor rather than 1.

zhijian-liu avatar Dec 28 '21 23:12 zhijian-liu

Adding @Xiuyu-Li and @kentangSJTU to this thread. We might need to support upsampling (nearest / trilinear) and downsampling in the future.

zhijian-liu avatar Dec 28 '21 23:12 zhijian-liu

I haven't checked the details of your implementation, but I think you are on the right track.

From my understanding, you might need to pass x.s to reconstruct the sparse tensor rather than 1.

Because it just aggregate on input resolution, so i pass 1. i will check again, thanks a lot

suyunzzz avatar Dec 29 '21 04:12 suyunzzz

Hi, @suyunzzz @zhijian-liu , sorry to bother you. I am looking for the torchsparse counterpart for MinkowskiInterpolation(). Any update on this issue? Or any possible suggestions for me to investigate will be greatly appreciated, thank you.

HaFred avatar Aug 21 '22 03:08 HaFred

@HaFred, thanks for your interest! Unfortunately, we haven't been able to look into this issue yet.

zhijian-liu avatar Oct 08 '22 00:10 zhijian-liu