Spaces:
Runtime error
Runtime error
Thanks hysts
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import shlex
|
| 2 |
import subprocess
|
| 3 |
|
| 4 |
-
|
| 5 |
subprocess.run(shlex.split("pip install pip==24.0"), check=True)
|
| 6 |
subprocess.run(
|
| 7 |
shlex.split(
|
|
@@ -14,12 +13,9 @@ subprocess.run(
|
|
| 14 |
), check=True
|
| 15 |
)
|
| 16 |
|
| 17 |
-
|
| 18 |
if __name__ == "__main__":
|
| 19 |
from huggingface_hub import snapshot_download
|
| 20 |
-
|
| 21 |
snapshot_download("public-data/Unique3D", repo_type="model", local_dir="./ckpt")
|
| 22 |
-
|
| 23 |
import os
|
| 24 |
import sys
|
| 25 |
sys.path.append(os.curdir)
|
|
@@ -27,28 +23,21 @@ if __name__ == "__main__":
|
|
| 27 |
torch.set_float32_matmul_precision('medium')
|
| 28 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 29 |
torch.set_grad_enabled(False)
|
| 30 |
-
|
| 31 |
import fire
|
| 32 |
import gradio as gr
|
| 33 |
from gradio_app.gradio_3dgen import create_ui as create_3d_ui
|
| 34 |
from gradio_app.all_models import model_zoo
|
| 35 |
|
| 36 |
-
|
| 37 |
_TITLE = '''Unique3D: High-Quality and Efficient 3D Mesh Generation from a Single Image'''
|
| 38 |
_DESCRIPTION = '''
|
| 39 |
-
|
| 40 |
<div>
|
| 41 |
<a style="display:inline-block" href='https://github.com/AiuniAI/Unique3D'><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/AiuniAI/Unique3D?style=social">
|
| 42 |
</a>
|
| 43 |
<img alt="GitHub License" src="https://img.shields.io/github/license/AiuniAI/Unique3D">
|
| 44 |
</div>
|
| 45 |
-
|
| 46 |
# [Paper](https://arxiv.org/abs/2405.20343) | [Project page](https://wukailu.github.io/Unique3D/) | [Huggingface Demo](https://huggingface.co/spaces/Wuvin/Unique3D) | [Gradio Demo](http://unique3d.demo.avar.cn/) | [Online Demo](https://www.aiuni.ai/)
|
| 47 |
-
|
| 48 |
* High-fidelity and diverse textured meshes generated by Unique3D from single-view images.
|
| 49 |
-
|
| 50 |
* The demo is still under construction, and more features are expected to be implemented soon.
|
| 51 |
-
|
| 52 |
* If the Huggingface Demo is overcrowded or fails to produce stable results, you can use the Online Demo [aiuni.ai](https://www.aiuni.ai/), which is free to try (get the registration invitation code Join Discord: https://discord.gg/aiuni). However, the Online Demo is slightly different from the Gradio Demo, in that the inference speed is slower, but the generation is much more stable.
|
| 53 |
'''
|
| 54 |
|
|
@@ -63,9 +52,27 @@ def launch():
|
|
| 63 |
with gr.Column(scale=1):
|
| 64 |
gr.Markdown('# ' + _TITLE)
|
| 65 |
gr.Markdown(_DESCRIPTION)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
create_3d_ui("wkl")
|
| 67 |
-
|
| 68 |
demo.queue().launch(share=True)
|
| 69 |
|
| 70 |
if __name__ == '__main__':
|
| 71 |
-
fire.Fire(launch)
|
|
|
|
| 1 |
import shlex
|
| 2 |
import subprocess
|
| 3 |
|
|
|
|
| 4 |
subprocess.run(shlex.split("pip install pip==24.0"), check=True)
|
| 5 |
subprocess.run(
|
| 6 |
shlex.split(
|
|
|
|
| 13 |
), check=True
|
| 14 |
)
|
| 15 |
|
|
|
|
| 16 |
if __name__ == "__main__":
|
| 17 |
from huggingface_hub import snapshot_download
|
|
|
|
| 18 |
snapshot_download("public-data/Unique3D", repo_type="model", local_dir="./ckpt")
|
|
|
|
| 19 |
import os
|
| 20 |
import sys
|
| 21 |
sys.path.append(os.curdir)
|
|
|
|
| 23 |
torch.set_float32_matmul_precision('medium')
|
| 24 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 25 |
torch.set_grad_enabled(False)
|
|
|
|
| 26 |
import fire
|
| 27 |
import gradio as gr
|
| 28 |
from gradio_app.gradio_3dgen import create_ui as create_3d_ui
|
| 29 |
from gradio_app.all_models import model_zoo
|
| 30 |
|
|
|
|
| 31 |
_TITLE = '''Unique3D: High-Quality and Efficient 3D Mesh Generation from a Single Image'''
|
| 32 |
_DESCRIPTION = '''
|
|
|
|
| 33 |
<div>
|
| 34 |
<a style="display:inline-block" href='https://github.com/AiuniAI/Unique3D'><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/AiuniAI/Unique3D?style=social">
|
| 35 |
</a>
|
| 36 |
<img alt="GitHub License" src="https://img.shields.io/github/license/AiuniAI/Unique3D">
|
| 37 |
</div>
|
|
|
|
| 38 |
# [Paper](https://arxiv.org/abs/2405.20343) | [Project page](https://wukailu.github.io/Unique3D/) | [Huggingface Demo](https://huggingface.co/spaces/Wuvin/Unique3D) | [Gradio Demo](http://unique3d.demo.avar.cn/) | [Online Demo](https://www.aiuni.ai/)
|
|
|
|
| 39 |
* High-fidelity and diverse textured meshes generated by Unique3D from single-view images.
|
|
|
|
| 40 |
* The demo is still under construction, and more features are expected to be implemented soon.
|
|
|
|
| 41 |
* If the Huggingface Demo is overcrowded or fails to produce stable results, you can use the Online Demo [aiuni.ai](https://www.aiuni.ai/), which is free to try (get the registration invitation code Join Discord: https://discord.gg/aiuni). However, the Online Demo is slightly different from the Gradio Demo, in that the inference speed is slower, but the generation is much more stable.
|
| 42 |
'''
|
| 43 |
|
|
|
|
| 52 |
with gr.Column(scale=1):
|
| 53 |
gr.Markdown('# ' + _TITLE)
|
| 54 |
gr.Markdown(_DESCRIPTION)
|
| 55 |
+
|
| 56 |
+
# Mensaje de agradecimiento para @hysts
|
| 57 |
+
gr.Markdown("""
|
| 58 |
+
### Special Thanks
|
| 59 |
+
A big thank you to [@hysts](https://huggingface.co/hysts) for their help in making the "Duplicate this Space" feature work correctly!
|
| 60 |
+
""")
|
| 61 |
+
|
| 62 |
+
# Agregamos el fragmento HTML aqu铆
|
| 63 |
+
gr.HTML("""
|
| 64 |
+
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;">
|
| 65 |
+
<p style="display: flex; gap: 6px;">
|
| 66 |
+
<a href="https://huggingface.co/spaces/cavargas10/Unico3D?duplicate=true">
|
| 67 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-lg.svg" alt="Duplicate this Space">
|
| 68 |
+
</a>
|
| 69 |
+
</p>
|
| 70 |
+
<p>to skip the queue and enjoy faster inference on the GPU of your choice</p>
|
| 71 |
+
</div>
|
| 72 |
+
""")
|
| 73 |
+
|
| 74 |
create_3d_ui("wkl")
|
|
|
|
| 75 |
demo.queue().launch(share=True)
|
| 76 |
|
| 77 |
if __name__ == '__main__':
|
| 78 |
+
fire.Fire(launch)
|