NVlabs / nvdiffrec

Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".
Other
2.09k stars 222 forks source link

The rendered images have some white blocks. #22

Open silence401 opened 2 years ago

silence401 commented 2 years ago

when I fix the mesh(without any material) to learn the material, the rendered images have some white blocks. image

jmunkberg commented 2 years ago

Hello @silence401 ,

I need more details in order to help. In general, locking the geometry should only make things easier (I assume you learn materials and lighting jointly above). The config https://github.com/NVlabs/nvdiffrec/blob/main/configs/spot_metal.json shows one example of locking the geometry.

Here is an example of the bob model with locked geom as well, showing the starting point, and the result. I suspect some issue with your dataset above. Is the lighting constant in all captured frame and are the masks and poses accurate?

img_mesh_pass_000000

img_mesh_pass_000010

Config:

{
    "base_mesh"  : "data/bob/bob_tri.obj",
    "ref_mesh"  : "data/bob/bob_tri.obj",
    "random_textures": true,
    "iter": 1000,
    "save_interval": 100,
    "texture_res": [ 1024, 1024 ],
    "train_res": [512, 512],
    "batch": 4,
    "learning_rate": [0.03, 0.003],
    "ks_min" : [0, 0.25, 0],
    "envmap": "data/irrmaps/aerodynamics_workshop_2k.hdr",
    "env_scale" : 2.0,
    "background": "white",
    "validate" : false,
    "lock_pos" : true,
    "out_dir": "bob_fix_geo"
}
silence401 commented 2 years ago

Thanks for your reply , I have a mesh without uv coodinate. So I run two pass, the first pass learn material['kd_ks_normal'] and then use xatlas to extract uv, finaly I run the second pass to learn material['ks'], material['kd'] etc. AND:

I Have Two Questions in fact:

  1. the white blocks described above.(the start point also have) image

  2. the render result in first pass is better than second pass(which also have some noises ) First Pass: image Second Pass: image

silence401 commented 2 years ago

Thanks for your reply , I have a mesh without uv coodinate. So I run two pass, the first pass learn material['kd_ks_normal'] and then use xatlas to extract uv, finaly I run the second pass to learn material['ks'], material['kd'] etc. AND:

  • the light is constant.
  • the poses and masks is right

I Have Two Questions in fact:

  1. the white blocks described above.(the start point also have) image
  2. the render result in first pass is better than second pass(which also have some noises ) First Pass: image Second Pass: image

the white block is bug of nvdiffrast, I update it and error disapear.

jmunkberg commented 2 years ago

Nice that you got it working! Are you saying that you used an older version of nvdiffrast, and when updating to the latest version of nvdiffrast it works? Our installation instructions should pull the latest version of nvdiffrast automatically.

silence401 commented 2 years ago

Nice that you got it working! Are you saying that you used an older version of nvdiffrast, and when updating to the latest version of nvdiffrast it works? Our installation instructions should pull the latest version of nvdiffrast automatically.

Yes, the nvdiffrast 0.2.7 not work but 0.2.8 work well, But I still have question about the second pass result is worse than the first pass descibed above.

jmunkberg commented 2 years ago

I still have question about the second pass result is worse than the first pass described above.

It is hard to say. In the second pass, we switch from volumetric texturing (using an MLP) to 2D textures, and, as discussed in the paper, in early stages of the second pass, texture seams are often visible, but usually disappear with some training. Some things to try: