gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.41k stars 2.42k forks source link

Showing Mesh Wireframe in Model3D #8447

Closed buaacyw closed 2 months ago

buaacyw commented 3 months ago

Is your feature request related to a problem? Please describe.
Sometimes users need to view the wireframe of mesh

Describe the solution you'd like
Provide an option to show wireframe of mesh in Model3D

Additional context
Recently there are some works focus on generating better mesh wireframes. (https://nihalsid.github.io/mesh-gpt/). Personally, I'm trying to use gradio to show my new work but find it impossible to render mesh wireframe.

abidlabs commented 3 months ago

Hi @buaacyw is there a particular file format / file extension for mesh wireframes that you need support for?

buaacyw commented 3 months ago

Thanks for your quick reply! Don't need to be a particular file format. Any mesh file format should be able to easily showing its wireframes. The result should be like this (a figure from MeshGPT): image

buaacyw commented 3 months ago

I believe this is quite easy to implement since you only need to highlight the edges.

abidlabs commented 3 months ago

It looks like this is supported in babylonjs, so it should be quite doable: https://www.babylonjs-playground.com/#QCU8DJ#22. We can add an argument in gr.Model3D called wireframe: bool, which if true would render the wireframe as well.

We don't have a lot of bandwidth at the moment, but if a community contributor wants to take this on, happy to review PRs

buaacyw commented 3 months ago

Thanks! I think adding an argument in Model3D would be nice. About the babylonjs, I have read the Gradio JS guide but still don't know how to use it. I hope to interactively view the 3D model with wireframe rendering. Are there examples?