openai / shap-e

Generate 3D objects conditioned on text or images
MIT License
11.68k stars 951 forks source link

How to render images with white background? #119

Open LordLiang opened 11 months ago

LordLiang commented 11 months ago

Wonderful work! I want to know how to render images with white background? The default bg color of "decode_latent_images" is black. How should I change the code? Thank you!

SOTAMak1r commented 8 months ago

My solution is to change the line 125 in shap-e/shap_e/models/nerf/ray.py:

results.output.channels = results.output.channels + results.transmittance * void_model(Query(origin, direc))

into:

results.output.channels = results.output.channels + results.transmittance * torch.ones_like(results.output.channels)

You can give it a try.