liruihui / PU-GAN

PU-GAN: a Point Cloud Upsampling Adversarial Network, ICCV, 2019
272 stars 45 forks source link

The uniform loss used in the project is not consistent with the paper. #18

Closed hzxie closed 4 years ago

hzxie commented 4 years ago

There are four uniform losses definition in the source code.

  1. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L50-L86
  2. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L89-L103
  3. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L110-L139
  4. https://github.com/liruihui/PU-GAN/blob/master/Common/model_utils.py#L307-L315

Could you tell me which one to use?

hzxie commented 4 years ago

I also want to ask a question about uniform loss. According to equation 4 in the paper, |S_j| = M = 50, \hat{n} = rNp. As mentioned in Sec. 4.1, p = rd^2 and rN = 1024. So the term U{imbalance}(S_j) = (50 - 1024 x p)^2 / (1024 x p).

Is it correct?

hzxie commented 4 years ago

I analyze the code and find that

https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L110-L139

is the one used by the project. But the implementation is different from that declared in the paper.

For example,

# expect_len =  tf.sqrt(2*disk_area/1.732)

is not used.

hzxie commented 4 years ago

I think neither the paper nor the code gives a clear explanation for the uniform loss.

I wonder whether the values in Table 1 are calculated with equation 6 in the paper.

hzxie commented 4 years ago

@liruihui Could you answer the questions above for me? Thank you.

I noticed that you closed the issue #9 and #10 two hours ago.

liruihui commented 4 years ago

There are four uniform losses definition in the source code.

  1. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L50-L86
  2. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L89-L103
  3. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L110-L139
  4. https://github.com/liruihui/PU-GAN/blob/master/Common/model_utils.py#L307-L315

Could you tell me which one to use?

The third one is used for training. For evaluation, we can use the GT mesh, you can check the https://github.com/liruihui/PU-GAN/blob/master/evaluate.py#L53-L102.

Ruihui Li

liruihui commented 4 years ago

I also want to ask a question about uniform loss. According to equation 4 in the paper, |S_j| = M = 50, \hat{n} = rNp. As mentioned in Sec. 4.1, p = rd^2 and rN = 1024. So the term U{imbalance}(S_j) = (50 - 1024 x p)^2 / (1024 x p).

Is it correct?

M is the number of seed point and it is not the number of point inside S_j.

Ruihui Li

liruihui commented 4 years ago

There are four uniform losses definition in the source code.

  1. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L50-L86
  2. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L89-L103
  3. https://github.com/liruihui/PU-GAN/blob/master/Common/loss_utils.py#L110-L139
  4. https://github.com/liruihui/PU-GAN/blob/master/Common/model_utils.py#L307-L315

Could you tell me which one to use?

The third one is used for training. For evaluation, we can use the GT mesh, you can check the https://github.com/liruihui/PU-GAN/blob/master/evaluate.py#L53-L102.

Ruihui Li

Sorry for the misleading. Here I want to provide all my scripts and someone may extend it with a better one.

Ruihui Li

hzxie commented 4 years ago

Thank you very much for your kind reply.

liruihui commented 4 years ago

💯

hzxie commented 4 years ago

Hi @liruihui What are disk_idx.txt, radius.txt, and point2mesh_distance.txt? I found they are generated by evaluation.cpp. However, it seems that the program takes GT as input.

Could you tell me how to generate these files without ground truth (such as on KITTI)?

liruihui commented 4 years ago

You can find all the files here. https://github.com/liruihui/PU-GAN/blob/master/evaluation_code/evaluation.cpp The compile config is referred in PU-Net