sicxu / Deep3dPortrait

Deep 3D Portrait from a Single Image
MIT License
381 stars 72 forks source link

How to use my own pictures for 3D reconstruction #29

Open jly0810 opened 2 years ago

jly0810 commented 2 years ago
  I want to use my photos to generate a 3D portrait model. I learned that in addition to photos, I also need several other files to input. 
  I have used the method here [https://github.com/sicxu/Deep3dPortrait/issues/9](url) to generate landmark.txt file.But I don't know how to generate the detection.txt files and the .mat file.
 I am a novice. I hope you can give me as detailed steps as possible to answer my doubts. Thank you very much for your help.
Ravindu-Yasas-Nagasinghe commented 2 years ago

Have you found a way to create detection.txt file? @jly0810 If so please mention the method.

zwyking commented 2 years ago

Hi, I have the same question! Have you find the way to generate them (.mat, landmark.txt)?

Bai426 commented 1 year ago

@sicxu Hi, Dr. Xu, this is a great work. I followed #25 and LeoGitGuy's suggestion, but the depth map has problem.

/home/neuralimage/Deep3dPortrait/utils/preprocess.py:27: FutureWarning: rcond parameter will change to the default of machine precision times max(M, N) where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond=-1. k, , , = np.linalg.lstsq(A, b) (239, 239, 3) (159, 159, 3) (79, 79) Traceback (most recent call last): File "step1_recon_3d_face.py", line 126, in face_recon(input_path, save_path, vis_path) File "step1_recon_3d_face.py", line 74, in face_recon crop_img, crop_mask, invparams, crop_lm, crop_param = headrecon_preprocess_withmask(img, mask, landmarks_2d, center2d.reshape([2]), s*s_factor/100) File "/home/neural_image/Deep3dPortrait/utils/preprocess.py", line 171, in headrecon_preprocess_withmask mask, lm.copy(), head_center.reshape([2]), scale, crp_w, crp_h, interpolation=cv2.INTER_NEAREST) File "/home/neural_image/Deep3dPortrait/utils/preprocess.py", line 69, in align_img croppedimg, = crop(img, bbox) File "/home/neural_image/Deep3dPortrait/utils/preprocess.py", line 53, in crop padded_img, padded_bbox = img_padding(img, bbox) File "/home/neural_image/Deep3dPortrait/utils/preprocess.py", line 49, in img_padding assert(bbox[0] >= 0 and bbox[1] >= 0) AssertionError__

Can you give me some advice? Thank you very much!

Best, Mike

syysummer commented 11 months ago

Hi, I have the same question! Have you find the way to generate them (.mat, landmark.txt)?

Have you found the method to generate landmark.txt, detection.txt, and .mat?

Bai426 commented 11 months ago

Just follow https://github.com/sicxu/Deep3dPortrait/issues/25 and other issues in this repo, you can generate these files.

syysummer commented 11 months ago

Just follow #25 and other issues in this repo, you can generate these files.

Thank you very much for your answer! I have obtained the coordinates of 68 key points, but when I obtained the initial .mat file, I found that "https://arxiv.org/pdf/1906.01342.pdf" was inaccessible. Do you have any ideas?