Uh oh!
There was an error while loading. Please reload this page.
Shap-E: add support for mesh output - #4062
Conversation
The documentation is not available anymore as the PR was closed or merged. |
| for k, (c1, c2) in enumerate(zip(tri[::2], tri[1::2])): | ||
| cases[i, j, k] = edge_to_index[(c1, c2) if c1 < c2 else (c2, c1)] | ||
| masks[i, j] = True | ||
| return cases, masks |
There was a problem hiding this comment.
I saved this lookup table as part of weights for renderer but this is how we can generate it if we want to include it in the code instead
cases is tensor of shape 256 x 5 x 3, masks is 256 x 5
patrickvonplaten
left a comment
There was a problem hiding this comment.
Great! very clean! Can we maybe just add a new section to the docs, showing how one can generate a mesh (just change output type) and then maybe linking to a generated mesh?
Uh oh!
There was an error while loading. Please reload this page.
What does this mean? |
sayakpaul
commented
Jul 13, 2023
I think Patrick meant hosting the generated mesh file on a repository on Hub so that folks can use that. If there are online visualization tools it would be cool to host one such generated mesh file and leave a link to the instance. @hysts what do you suggest? |
sayakpaul
commented
Jul 13, 2023
I think @yiyixuxu has updated the Shap-E repository from her personal profile. Let's not forget to transfer them to OpenAI and update the model cards accordingly with this support. |
hysts
commented
Jul 13, 2023
As HF Hub supports mesh visualization, maybe we can upload generated 3D mesh samples as dataset. out.mp4 |
sayakpaul
commented
Jul 13, 2023
@yiyixuxu let's make sure this in the documentation :) |
hysts
commented
Jul 13, 2023
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
yiyixuxu
commented
Jul 13, 2023
great point! but this requires installing
same, I think it requires additional dependency so prefer to document it instead CC @patrickvonplaten let me know what you think about this |
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
yiyixuxu
commented
Jul 13, 2023
this is so cool! thanks! I didn't know that |
sayakpaul
commented
Jul 14, 2023
Big +1 here. Let's make sure to document them. And also let the readers know about the capability of https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb. Together, this collection is starting to look really really amazing. Thanks for your hard work, @yiyixuxu ❤️ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
patrickvonplaten
commented
Jul 17, 2023
Feel free to merge @yiyixuxu |
yiyixuxu
commented
Jul 20, 2023
@patrickvonplaten can I have a final look? think it is good to go now sent 2 PR on the openai repo too: |
yiyixuxu
commented
Jul 20, 2023
ohh forgot about tests... fixing it now |
pcuenca
left a comment
There was a problem hiding this comment.
The tests look fine to me. I suppose we just need to merge the PRs in the HF repos, right?
I think it would have been better to leave |
yiyixuxu
commented
Jul 20, 2023
ohhh yes should have done that |
* add output_type=mesh * update img2img * make style * add doc * make style * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * add docstring for output_type * add a section in doc about hub mesh visualization/ rotation * update conversion script so default background is white * Apply suggestions from code review Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * renderer -> shap_e_renderer * img2img renderer -> shap_e_renderer * fix tests --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* add output_type=mesh * update img2img * make style * add doc * make style * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * add docstring for output_type * add a section in doc about hub mesh visualization/ rotation * update conversion script so default background is white * Apply suggestions from code review Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * renderer -> shap_e_renderer * img2img renderer -> shap_e_renderer * fix tests --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* add output_type=mesh * update img2img * make style * add doc * make style * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * add docstring for output_type * add a section in doc about hub mesh visualization/ rotation * update conversion script so default background is white * Apply suggestions from code review Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * renderer -> shap_e_renderer * img2img renderer -> shap_e_renderer * fix tests --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* add output_type=mesh * update img2img * make style * add doc * make style * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * add docstring for output_type * add a section in doc about hub mesh visualization/ rotation * update conversion script so default background is white * Apply suggestions from code review Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * renderer -> shap_e_renderer * img2img renderer -> shap_e_renderer * fix tests --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
* add output_type=mesh * update img2img * make style * add doc * make style * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * add docstring for output_type * add a section in doc about hub mesh visualization/ rotation * update conversion script so default background is white * Apply suggestions from code review Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py Co-authored-by: Sayak Paul <spsayakpaul@gmail.com> * renderer -> shap_e_renderer * img2img renderer -> shap_e_renderer * fix tests --------- Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>


This PR adds support to mesh output for Shap-E
#3986