Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
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,13 +23,11 @@ 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 |
<div>
|
@@ -45,6 +39,16 @@ _DESCRIPTION = '''
|
|
45 |
* High-fidelity and diverse textured meshes generated by Unique3D from single-view images.
|
46 |
* The demo is still under construction, and more features are expected to be implemented soon.
|
47 |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
'''
|
49 |
|
50 |
def launch():
|
@@ -59,7 +63,6 @@ def launch():
|
|
59 |
gr.Markdown('# ' + _TITLE)
|
60 |
gr.Markdown(_DESCRIPTION)
|
61 |
create_3d_ui("wkl")
|
62 |
-
|
63 |
demo.queue().launch(share=True)
|
64 |
|
65 |
if __name__ == '__main__':
|
|
|
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>
|
|
|
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 |
+
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; margin-top: 20px;">
|
44 |
+
<p style="display: flex; gap: 6px;">
|
45 |
+
<a href="https://huggingface.co/spaces/cavargas10/Unico3D?duplicate=true">
|
46 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-lg.svg" alt="Duplicate this Space">
|
47 |
+
</a>
|
48 |
+
</p>
|
49 |
+
<p>Click the button above to duplicate this space and enjoy faster inference on the GPU of your choice.</p>
|
50 |
+
<p style="margin-top: 10px;">Special thanks to <strong>@hysts</strong> for helping to make the "Duplicate this Space" functionality work correctly!</p>
|
51 |
+
</div>
|
52 |
'''
|
53 |
|
54 |
def launch():
|
|
|
63 |
gr.Markdown('# ' + _TITLE)
|
64 |
gr.Markdown(_DESCRIPTION)
|
65 |
create_3d_ui("wkl")
|
|
|
66 |
demo.queue().launch(share=True)
|
67 |
|
68 |
if __name__ == '__main__':
|