PU-GAN icon indicating copy to clipboard operation
PU-GAN copied to clipboard

Choosing seed points and growing a patch from a seed point

Open Nhunguts opened this issue 3 years ago • 16 comments

Hi all, The paper shows that " randomly find 200 seed positions on each mesh surface, geodesically grow a patch from each seed", but I can't find where is in the code shows the seed points are chosen, and a patch is grown from a seed point. Could you please help me with this @liruihui ? Thank you.

Nhunguts avatar Jul 05 '21 06:07 Nhunguts

Pls check here. You will find how to work as I described. :) https://github.com/yulequan/PU-Net/tree/master/prepare_data (Mesh Segmentation)

liruihui avatar Jul 05 '21 06:07 liruihui

Thank you, @liruihui for your quick reply. I would ask you for some more support:

  1. I understand that, the h5 training file contains the coordinate of ground truth point clouds and the low-resolution point clouds, isn't it?
  2. That means the h5 file doesn't contain the information about seed points, right?
  3. The purpose of "Mesh Segmentation" is to divide a mesh into several smaller meshes? Thank you so much for your time.

Nhunguts avatar Jul 05 '21 07:07 Nhunguts

Yes for all :)

liruihui avatar Jul 05 '21 07:07 liruihui

Hi @liruihui, I can divide the original point clouds to smaller point clouds and create h5 file by myself. Now I want to change the way I choose the seed points (you chose by randomly 200 seed points per one mesh), and I also want to change the size of patches (in your paper "each patch occupies ∼5% of the object surface"). Please help me where is in the code shown this task? Thank you for staying with me.

Nhunguts avatar Jul 05 '21 08:07 Nhunguts

You can change the seed number and size of the patch in the Mesh Segmentation. (It is a .sln project). The code is on the main cpp file.

liruihui avatar Jul 05 '21 08:07 liruihui

Hi @liruihui , so, how many points in a patch in your experience? I can see there are about 700 points in a patch in the example of the PU-Net. Thank you.

Nhunguts avatar Jul 05 '21 11:07 Nhunguts

You can change the seed number and size of the patch in the Mesh Segmentation. (It is a .sln project). The code is on the main cpp file.

Hi @liruihui , this is the ReadMe from the MeshSegmentation folder: MeshSegmentation.exe

when running the exe file, please enter the following three parameters:

1, mesh file name 2, patch number you want to cut 3, patch radius for each patch

Following is an example: MeshSegmentation.exe egea.off 10 5.0

Is "patch number" (10) equal to seed points number? And does "radius" (0.5) show the size of each patch? Thank you.

Nhunguts avatar Jul 06 '21 00:07 Nhunguts

Yes. If possible, pls read the code and test it several times. It should be easier for your understanding. :)

liruihui avatar Jul 06 '21 01:07 liruihui

Hi @liruihui, sorry to bother you again. In your code, how can I change the parameter "p" - the expected percentage of points in Sj (denoted as p)? Thank you.

Nhunguts avatar Sep 25 '21 12:09 Nhunguts

It is in the uniform_loss for triaing and evaluation code for testing

liruihui avatar Sep 26 '21 02:09 liruihui

Hi @liruihui , thank you for your quick response. I am trying to use the evaluate.py to assess my model. The result shows Chamfer and Hausdorff distances, but it shows nothing for "p2f" and "uniform". Could you please help me with what should I check? And could you please give me an example of the file "pred_path[:-4]_point2mesh_distance.txt" or "pred_path[:-4] + "_disk_idx.txt"" Thank you for your help, I appreciate it. My ground truth point cloud have 4096 points, up-ratio = 8.

Nhunguts avatar Sep 26 '21 05:09 Nhunguts

Pls follow the evaluation step. first compile the evluation.cpp, evaluate on the model and then using the evluation.py

For more information, you can check the cpp code

liruihui avatar Sep 26 '21 06:09 liruihui

You can change the seed number and size of the patch in the Mesh Segmentation. (It is a .sln project). The code is on the main cpp file.

Hi @liruihui , this is the ReadMe from the MeshSegmentation folder: MeshSegmentation.exe

when running the exe file, please enter the following three parameters:

1, mesh file name 2, patch number you want to cut 3, patch radius for each patch

Following is an example: MeshSegmentation.exe egea.off 10 5.0

Is "patch number" (10) equal to seed points number? And does "radius" (0.5) show the size of each patch? Thank you.

I got a lot of error while building MeshSegmenatation. I tried to build the Meshsegmentation on Windows with Visual Studio 2017 but I met a lot of error. Can you please share me the version of your VS and the way of building this code in detail?

ChenFFCs avatar Apr 27 '22 14:04 ChenFFCs

patch number (10) is equal to the seed points number and the radius represents the size of each patch.

I used both vs2017 and 2019, and it can be compiled with no further adjustments.

liruihui avatar Apr 28 '22 01:04 liruihui

patch number (10) is equal to the seed points number and the radius represents the size of each patch.

I used both vs2017 and 2019, and it can be compiled with no further adjustments.

Thank you for your quick response.

This is my mistake, I found these incorrect declarations in kernelt.h, but the file already contains the header file, still reported an error.

d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C2065: “vertex_size”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C3861: “vertex_size”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): note: “vertex_size”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C2065: “vertex_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C3861: “vertex_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): note: “vertex_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C2065: “vertex_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C3861: “vertex_end”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): note: “vertex_end”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C2065: “facet_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C3861: “facet_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): note: “facet_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C2065: “facet_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C3861: “facet_end”: 找不到标识符

ChenFFCs avatar Apr 28 '22 09:04 ChenFFCs

patch number (10) is equal to the seed points number and the radius represents the size of each patch. I used both vs2017 and 2019, and it can be compiled with no further adjustments.

Thank you for your quick response.

This is my mistake, I found these incorrect declarations in kernelt.h, but the file already contains the header file, still reported an error.

d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C2065: “vertex_size”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C3861: “vertex_size”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): note: “vertex_size”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C2065: “vertex_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C3861: “vertex_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): note: “vertex_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C2065: “vertex_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C3861: “vertex_end”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): note: “vertex_end”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C2065: “facet_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C3861: “facet_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): note: “facet_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C2065: “facet_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C3861: “facet_end”: 找不到标识符

patch number (10) is equal to the seed points number and the radius represents the size of each patch. I used both vs2017 and 2019, and it can be compiled with no further adjustments.

Thank you for your quick response.

This is my mistake, I found these incorrect declarations in kernelt.h, but the file already contains the header file, still reported an error.

d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C2065: “vertex_size”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): error C3861: “vertex_size”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(56): note: “vertex_size”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C2065: “vertex_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): error C3861: “vertex_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(72): note: “vertex_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C2065: “vertex_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): error C3861: “vertex_end”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(73): note: “vertex_end”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C2065: “facet_begin”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): error C3861: “facet_begin”: 找不到标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(81): note: “facet_begin”: 函数声明必须可用,因为所有参数都不依赖于模板参数 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C2065: “facet_end”: 未声明的标识符 1>d:\google\pu-net-master\prepare_data\meshsegmentation\source code\mesh\extension\exkernelt.cpp(82): error C3861: “facet_end”: 找不到标识符

Hi,@ChenFFCs,I have the same question with you, have you solved it?

kangya998 avatar Dec 06 '22 14:12 kangya998