MrTornado24 / Next3D

[CVPR 2023 Highlight] Next3D: Generative Neural Texture Rasterization for 3D-Aware Head Avatars
https://mrtornado24.github.io/Next3D/
470 stars 29 forks source link

Missing data/ffhq/head_template.obj #7

Closed sunshineatnoon closed 1 year ago

sunshineatnoon commented 1 year ago

Hi, Thanks for open-sourcing the code!

I'm trying to run the demo with reload_modules=True such that I can follow each step in the code. But I encountered the following error FileNotFoundError: [Errno 2] No such file or directory: 'data/ffhq/head_template.obj'. Could you please upload the missing obj file? Thanks!

RaymondJiangkw commented 1 year ago

I think the 'head_template.obj' could be downloaded from here.

Alternatively, you could comment out all the relevant codes about reading some missing files and doing certain calculations, and simply copy the processed data from the pretrained checkpoint into your reloaded module. It works fine.

jingyang2017 commented 1 year ago

Hi, Thanks for the code. I met another problem when I set reload_modules=True. /pytorch3d/pytorch3d/io/obj_io.py:548: UserWarning: Mtl file does not exist: data/ffhq/template.mtl warnings.warn(f"Mtl file does not exist: {f}"). The warning caused broken face in generation.

RaymondJiangkw commented 1 year ago

Hi, I think you can try to replace the L171-172 of 'triplane_next3d.py' with following codes:

alpha_image = torch.cat((alpha_images[0], torch.zeros_like(alpha_images[0]), torch.zeros_like(alpha_images[0])), 1).unsqueeze(2)
rendering_stitch = torch.cat((rendering_stitch, torch.zeros_like(rendering_images[1]), torch.zeros_like(rendering_images[2])), 1)

It may work.

jingyang2017 commented 1 year ago

Thanks!

sunshineatnoon commented 1 year ago

Thanks for the quick reply!