clinplayer / Point2Skeleton

Point2Skeleton: Learning Skeletal Representations from Point Clouds (CVPR2021)
MIT License
206 stars 38 forks source link

Training on custom Data #20

Closed davodogster closed 1 year ago

davodogster commented 1 year ago

Hi nice paper!

I have PCD + Skeleton + Mesh. Do you think it's possible for me to implement your model with my data? I want to learn the skeleton from the PCD.

image

Thanks, Sam

clinplayer commented 1 year ago

Hey, point2skeleton is an unsupervised model. Whereas now you have the skeleton, which means you get the ground truth, and it becomes a supervised learning task. The network training can be directly supervised by the prepared skeleton.

I suppose the results could be better since the ground truth is given. But I'm not completely sure, considering the structure of your tree model looks very very complex. You can try to amend the loss function in SkelPointNet.py. https://github.com/clinplayer/Point2Skeleton/blob/7c44ec137c5ec3b0026f01c28b5554e4cc893d65/src/SkelPointNet.py#L105

davodogster commented 1 year ago

Hi @clinplayer thanks for getting back to me! So could I use your repo to train a supervised model? Which part of the loss function should I change? One problem is that my number of points in the point cloud is far greater than my number of edges in the skeleton.

clinplayer commented 1 year ago

Yes, it should work. I think for the skeletal point prediction module, you can modify the following function - directly using the CD loss between skel_xyz and shape_xyz, where the shape_xyz should be replaced by your GT skeletal points. https://github.com/clinplayer/Point2Skeleton/blob/7c44ec137c5ec3b0026f01c28b5554e4cc893d65/src/SkelPointNet.py#L105

Then it seems your skeletons only contain curve lines without any faces, you can first try if the initial skeletons generated by graph initialization meet your requirement, by using the following function: https://github.com/clinplayer/Point2Skeleton/blob/7c44ec137c5ec3b0026f01c28b5554e4cc893d65/src/SkelPointNet.py#L177

davodogster commented 1 year ago

@clinplayer thanks! I already have the skeleton edges and vertices, so I don't think I need KNN or init_graph function as I may already have the information??

image

clinplayer commented 1 year ago

Do you mean you want to make the network predict the edge connections by learning from your ground-truth data? One problem is that the predicted skeleton vertices may not have consistent correspondences with your groud truth; thus I'm not sure if you can use the edge informationto train the network.