-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Babylon update for model3D #10847
base: main
Are you sure you want to change the base?
Babylon update for model3D #10847
Conversation
Thanks for the PR @CedricGuillemet. Left a few comments, but overall looks great when testing! |
@CedricGuillemet Also we've recevied a few requests for other file types, specifically |
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/2092735748c525e53e71dcace7c684171a079020/gradio-5.23.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@2092735748c525e53e71dcace7c684171a079020#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/2092735748c525e53e71dcace7c684171a079020/gradio-client-1.14.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/2092735748c525e53e71dcace7c684171a079020/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
The Babylon Viewer has a handful of other features that are probably also useful in gradio:
If anyone is curious, there is more info on the Babylon Viewer here: https://babylonjs.com/viewer/ |
No for fbx, @CedricGuillemet can comment on usdz. Other formats that are already supported (beyond gltf/blg) are: obj, stl, splat, spz. |
usdz in still on my radar. I have a working branch to add its support in Babylon that I will re-open after Babylon 8.0 release. No plan for .fbx format. .usdz support is possible thanks to https://github.com/lighttransport/tinyusdz and its wasm build. I guess a wasm fbx I/O is possible too. |
It should be fixed now. |
@CedricGuillemet Seems like the reset camera button doesn't work again. |
On it! Sorry for the inconvenience. |
I can reset the camera: I run the sample from |
@CedricGuillemet Sorry just tested again, and seems to work fine! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some tests are failing. After looking into it a bit I noticed that providing a default value to model3D doesn't work anymore.
ex: inputs=gr.Model3D(value="files/Bunny.obj")
Repro:
demo/model3D
import gradio as gr
import os
def load_mesh(mesh_file_name):
return mesh_file_name
demo = gr.Interface(
fn=load_mesh,
inputs=gr.Model3D(value="files/Bunny.obj"),
outputs=gr.Model3D(
clear_color=(0.0, 0.0, 0.0, 0.0), label="3D Model", display_mode="wireframe"),
examples=[
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
[os.path.join(os.path.dirname(__file__), "files/Fox.gltf")],
[os.path.join(os.path.dirname(__file__), "files/face.obj")],
[os.path.join(os.path.dirname(__file__), "files/sofia.stl")],
["https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k-mini.splat"],
["https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/luigi/luigi.ply"],
],
cache_examples=True
)
if __name__ == "__main__":
demo.launch()
I'm on it! Thanks for the repro. |
@CedricGuillemet Looks like its only happening on dev mode/SSR (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the ssr Issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks folks!
Description
Update Babylon.js dependency from 7.25.1 to 7.54.0. Use Babylon viewer as a ES module to reduce .js size.
No change to supported file formats (obj, gtlf,...)
Closes: #10846
Changes
Improvements
Current Canvas3D size : 4.6Mb
Updated Canvas3D size: 1.2Mb
Viewer will try to use WebGPU when available for faster rendering and lower CPU usage
Known limitations
Wireframe and points rendering use triangles and vertices color. It's not using a plain solid one (see screenshot). If this is a problem, I can update Babylon.js code to support a solid color and expose it as a property.