Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- requirements.txt +2 -2
- run.ipynb +1 -1
- run.py +2 -2
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
gradio-client @ git+https://github.com/gradio-app/gradio@
|
| 2 |
-
https://gradio-pypi-previews.s3.amazonaws.com/
|
|
|
|
| 1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@103e3ab8e95fbbbd3a099c297d91c6c5cb1c6615#subdirectory=client/python
|
| 2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/103e3ab8e95fbbbd3a099c297d91c6c5cb1c6615/gradio-5.48.0-py3-none-any.whl
|
run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: model3D"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: model3D"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "# get_model3d() returns the file path to sample 3D models included with Gradio\n", "from gradio.media import get_model3d, MEDIA_ROOT\n", "\n", "\n", "def load_mesh(mesh_file_name):\n", " return mesh_file_name\n", "\n", "\n", "demo = gr.Interface(\n", " fn=load_mesh,\n", " inputs=gr.Model3D(label=\"Other name\", display_mode=\"wireframe\"),\n", " outputs=gr.Model3D(\n", " clear_color=(0.0, 0.0, 0.0, 0.0), label=\"3D Model\", display_mode=\"wireframe\"\n", " ),\n", " examples=[\n", " [get_model3d(\"Bunny.obj\")],\n", " [get_model3d(\"Duck.glb\")],\n", " [get_model3d(\"Fox.gltf\")],\n", " [get_model3d(\"face.obj\")],\n", " [get_model3d(\"sofia.stl\")],\n", " [\n", " \"https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k-mini.splat\"\n", " ],\n", " [\n", " \"https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/luigi/luigi.ply\"\n", " ],\n", " ],\n", " cache_examples=True,\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch(allowed_paths=[str(MEDIA_ROOT)])\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
# get_model3d() returns the file path to sample 3D models included with Gradio
|
| 3 |
-
from gradio.media import get_model3d
|
| 4 |
|
| 5 |
|
| 6 |
def load_mesh(mesh_file_name):
|
|
@@ -30,4 +30,4 @@ demo = gr.Interface(
|
|
| 30 |
)
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
# get_model3d() returns the file path to sample 3D models included with Gradio
|
| 3 |
+
from gradio.media import get_model3d, MEDIA_ROOT
|
| 4 |
|
| 5 |
|
| 6 |
def load_mesh(mesh_file_name):
|
|
|
|
| 30 |
)
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
+
demo.launch(allowed_paths=[str(MEDIA_ROOT)])
|