HavenFeng/photometric_optimization

Custom image

hbinol opened this issue · 16 comments

Nice work!

I wonder how can I apply this for a custom image?

I guess I need both

  • a landmark file ( landmarkpath = os.path.sep.join([input_folder, image_name + '.npy']) )
  • image mask file ( image_mask_path = os.path.sep.join([image_mask_folder, image_name + '.npy']) )

for the custom image, right? Do I need more than this? How can I obtain these files for a custom image?

Thanks!

Yes, you would need both, as we've described in the readme file.

Thank you for your answer.

The next question is how can I generate these .npy files? Is there any sample script for those applications (face_alignment & face_seg)?

Thank you for your answer.

The next question is how can I generate these .npy files? Is there any sample script for those applications (face_alignment & face_seg)?

my fork solves the custom image

Thank you so much @JacksonL1

Do you have any idea about how I can pick a point (or points) on the neck of the initial 3D mesh template and follow its trajectory during photometric optimization? In a nutshell, I want to know where are the neck points of the final mesh compared to 2D or 3D landmarks.

Thank you so much @JacksonL1

Do you have any idea about how I can pick a point (or points) on the neck of the initial 3D mesh template and follow its trajectory during photometric optimization? In a nutshell, I want to know where are the neck points of the final mesh compared to 2D or 3D landmarks.

I just know that at face-parsing.Pytorch project, the 14th part is neck.
use this part to generate the mask and calculate the photometric loss.
Hope answered your question

That's great! Thank you @JacksonL1

I need to solve the problem of distance calculation between a neck point and chin on the final 3D mesh.

I don't know how to get points on the neck. I'm sorry about that~

Hi @JacksonL1

For your work, I got an error like below

No such file or directory: './model/s3fd.pth'

I found that later, but now there is another missing file

/model/face_seg.pth

hi @hbinol
you can find the model at link extract code:1emq

@hbinol
if you can not use the Baidu Cloud, also can find the model at Google Cloud

@JacksonL1 I need access to Google Cloud. I believe I've already requested access.

@hbinol download official pre-train model and rename to face_seg.pth

@hbinol download official pre-train model and rename to face_seg.pth

Hi @JacksonL1 Thanks for your work.
I just met a problem 'Expected object of scalar double but got scalar type float for sequence element 4 when running your package. It comes from 'wj_fitting.py, line 175, in optimize'. Do you have any idea about this? Thank you.

@hbinol download official pre-train model and rename to face_seg.pth

Hi @JacksonL1 Thanks for your work.
I just met a problem 'Expected object of scalar double but got scalar type float for sequence element 4 when running your package. It comes from 'wj_fitting.py, line 175, in optimize'. Do you have any idea about this? Thank you.

I just run the code, it will run smoothly.
The error seems like data type is wrong. Could you show me the code near by 175 and full error message?

谢谢您的回答。
下一个问题是如何生成这些 .npy 文件?这些应用程序(face_alignment 和 face_seg)是否有任何示例脚本?

我的叉子解决了自定义图像

How to change the color of 3D mesh