pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.16k stars 3.64k forks source link

Regression with pytorch geometric #2393

Open ttsesm opened 3 years ago

ttsesm commented 3 years ago

Hi @rusty1s,

I am interested to use pytorch_geometric for a regression problem and I wanted to ask you whether you think it would be possible. To give you an understanding of my dataset I have a set of point clouds of different sizes and for which I have available the vertices n, faces f (quad meshed) and a set of features vector fx8 which include the normals, the centroid, the face area, etc. Now for each face I would like to regress an intensity value for the corresponding target that I want to give as an input. Due to the spatial arrangement of my dataset I would have a lot of occlusions and a kind of long tail distribution of these intensity values.

Considering that I am quite new to pytorch_geometric/GCNs/GNNs do you think that this would be feasible. If yes do you have any specific model which you think that it would be best to use and possibly point me to point me to an example if there is any.

Thanks a lot.

rusty1s commented 3 years ago

PyG support for meshes is currently limited to converting faces to edges and treating meshes as simple graphs, but we have an open PR for MeshCNN which might be more suitable for your problem. Feel free to test it out :)

ttsesm commented 3 years ago

Hi Matthias,

Thank you for the feedback, indeed MeshCNN seems quite interesting. I will give it a try.

ttsesm commented 3 years ago

@Omri-L checking on the PR for the MeshCNN I am trying to use the example from here. Is there an easy way though to load my dataset in the format that MeshCNN accepts?

My data (vertices, faces, center points, normals, target values, etc I guess I can also extract the edges) are in .csv format. Looking into the mesh_cnn_base_datasets.py it is not quite clear how to load each of the input and feature vectors accordingly. Any idea would be helpful.

Omri-L commented 3 years ago

@Omri-L checking on the PR for the MeshCNN I am trying to use the example from here. Is there an easy way though to load my dataset in the format that MeshCNN accepts?

My data (vertices, faces, center points, normals, target values, etc I guess I can also extract the edges) are in .csv format. Looking into the mesh_cnn_base_datasets.py it is not quite clear how to load each of the input and feature vectors accordingly. Any idea would be helpful.

Hi @ttsesm, MeshCNN works with .obj files (you can see an example of different datasets in the link you shared here). If you want to understand fully how it loads the data, you should go to get function in MeshCnnClassificationDataset class here. The actual loading is in MeshPrepare class here - go to "from_scratch" function. Hope it helps.

ttsesm commented 3 years ago

Thanks a lot, quite helpful. I think I could modify the from_scratch() function to load my data.

Skipping through the from_scratch() function I have a few more questions though:

  1. Is it possible to load any custom extra features other than the ones extracted here.

  2. My meshes point coordinates are in meters which could vary from 0 to 10/15m on each mesh, do I need to normalize them to [0,1] or it is not necessary. If yes, each mesh should be normalized individually based on each own min, max dimensionality or based on the min, max dimensions of the whole dataset.

davodogster commented 2 years ago

@ttsesm Hi, did you have any success with the mesh regression?