shunsukesaito / PIFu

This repository contains the code for the paper "PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization"
https://shunsukesaito.github.io/PIFu/
Other
1.76k stars 341 forks source link

Is this the right training process? #59

Closed Qingcsai closed 4 years ago

Qingcsai commented 4 years ago

Hi, shunsukesaito!

I am traing PIFu using my own datasets, which have 300 human mesh for traing, 100 mesh for testing. I set learning_rate=0.001, Sigma=0.1,batch_size=16, in the first 5 epochs, the error during training is shocking between 0.07-0.16, is seems like won't converge? When I check some mesh generated during testing at the end of each epoch, it seems weired, here's the result at epoch 4:

generated mesh: image

the input image: image

Do you think it the resonable results during training? How to converge fast? I hope I didn't bother you, expecting to your reply! thanks!

shunsukesaito commented 4 years ago

The error and reconstruction quality seems worse than what it should be. Although it's difficult to accurately diagnose with your specific scenario, there are several educated guesses:

Thanks for trying out PIFu framework!

Qingcsai commented 4 years ago

Thanks for your quickly reply! In fact, my original datasets before using render_data.py is not standing along Y axis, but the human standing along Z axis(facing the negative Y axis), which means the ground truth mesh has 90° difference from your provided free mesh.

So I did one thing during rendering, I changed R = np.matmul(R, make_rotate(math.radians(90),0,0)) with R = np.matmul(R, make_rotate(math.radians(-90),0,0)) in

https://github.com/shunsukesaito/PIFu/blob/30b428ba74bd7743a17c19fa20f6bfd39b1de057/apps/render_data.py#L218

Then I got the correct direction of the ground truth mesh when generating data.

Before changing: image

After changing: image

I wonder is it enough changes in codes for trainging shape? Or is it the reason why resulting in inaccurate alignment between input image and project 3d points?

Looking forward to your reply! Thanks.

shunsukesaito commented 4 years ago

I would suggest projecting the sampled points of the body mesh onto input images using the same code as your projection operator. If everything is correct, you should be able to see the projected points aligned with the input image,

Qingcsai commented 4 years ago

Okay, thanks for your advice, I would try with it.