Carlos Vargas R commited on
Commit
69b6a88
1 Parent(s): b79871d

Add application file

Browse files
Files changed (3) hide show
  1. app.py +63 -0
  2. requirements-detail.txt +27 -0
  3. requirements.txt +29 -0
app.py ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import shlex
2
+ import subprocess
3
+ subprocess.run(
4
+ shlex.split(
5
+ "pip install package/onnxruntime_gpu-1.17.0-cp310-cp310-manylinux_2_28_x86_64.whl --force-reinstall --no-deps"
6
+ )
7
+ )
8
+ subprocess.run(
9
+ shlex.split(
10
+ "pip install package/nvdiffrast-0.3.1.torch-cp310-cp310-linux_x86_64.whl --force-reinstall --no-deps"
11
+ )
12
+ )
13
+
14
+ if __name__ == "__main__":
15
+ import os
16
+ import sys
17
+ sys.path.append(os.curdir)
18
+ import torch
19
+ torch.set_float32_matmul_precision('medium')
20
+ torch.backends.cuda.matmul.allow_tf32 = True
21
+ torch.set_grad_enabled(False)
22
+
23
+ import fire
24
+ import gradio as gr
25
+ from gradio_app.gradio_3dgen import create_ui as create_3d_ui
26
+ from gradio_app.all_models import model_zoo
27
+
28
+
29
+ _TITLE = '''Unique3D: High-Quality and Efficient 3D Mesh Generation from a Single Image'''
30
+ _DESCRIPTION = '''
31
+
32
+ <div>
33
+ <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">
34
+ </a>
35
+ <img alt="GitHub License" src="https://img.shields.io/github/license/AiuniAI/Unique3D">
36
+ </div>
37
+
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](https://u45213-bcf9-ef67553e.westx.seetacloud.com:8443/) | [Online Demo](https://www.aiuni.ai/)
39
+
40
+ * High-fidelity and diverse textured meshes generated by Unique3D from single-view images.
41
+
42
+ * The demo is still under construction, and more features are expected to be implemented soon.
43
+
44
+ * 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.
45
+ '''
46
+
47
+ def launch():
48
+ model_zoo.init_models()
49
+
50
+ with gr.Blocks(
51
+ title=_TITLE,
52
+ # theme=gr.themes.Monochrome(),
53
+ ) as demo:
54
+ with gr.Row():
55
+ with gr.Column(scale=1):
56
+ gr.Markdown('# ' + _TITLE)
57
+ gr.Markdown(_DESCRIPTION)
58
+ create_3d_ui("wkl")
59
+
60
+ demo.queue().launch(share=True)
61
+
62
+ if __name__ == '__main__':
63
+ fire.Fire(launch)
requirements-detail.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate==0.29.2
2
+ datasets==2.18.0
3
+ diffusers==0.27.2
4
+ fire==0.6.0
5
+ gradio==4.32.0
6
+ jaxtyping==0.2.29
7
+ numba==0.59.1
8
+ numpy==1.26.4
9
+ nvdiffrast==0.3.1
10
+ omegaconf==2.3.0
11
+ onnxruntime_gpu==1.17.0
12
+ opencv_python==4.9.0.80
13
+ opencv_python_headless==4.9.0.80
14
+ ort_nightly_gpu==1.17.0.dev20240118002
15
+ peft==0.10.0
16
+ Pillow==10.3.0
17
+ pygltflib==1.16.2
18
+ pymeshlab==2023.12.post1
19
+ pytorch3d==0.7.5
20
+ rembg==2.0.56
21
+ torch==2.1.0+cu121
22
+ torch_scatter==2.1.2
23
+ tqdm==4.64.1
24
+ transformers==4.39.3
25
+ trimesh==4.3.0
26
+ typeguard==2.13.3
27
+ wandb==0.16.6
requirements.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pytorch3d @ https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cu121_pyt221/pytorch3d-0.7.6-cp310-cp310-linux_x86_64.whl
2
+ ort_nightly_gpu @ https://aiinfra.pkgs.visualstudio.com/2692857e-05ef-43b4-ba9c-ccf1c22c437c/_packaging/d3daa2b0-aa56-45ac-8145-2c3dc0661c87/pypi/download/ort-nightly-gpu/1.17.dev20240118002/ort_nightly_gpu-1.17.0.dev20240118002-cp310-cp310-manylinux_2_28_x86_64.whl
3
+ onnxruntime_gpu @ https://pkgs.dev.azure.com/onnxruntime/2a773b67-e88b-4c7f-9fc0-87d31fea8ef2/_packaging/7fa31e42-5da1-4e84-a664-f2b4129c7d45/pypi/download/onnxruntime-gpu/1.17/onnxruntime_gpu-1.17.0-cp310-cp310-manylinux_2_28_x86_64.whl
4
+ torch==2.2.0
5
+ accelerate
6
+ datasets
7
+ diffusers>=0.26.3
8
+ fire
9
+ gradio
10
+ jaxtyping
11
+ numba
12
+ numpy
13
+ omegaconf>=2.3.0
14
+ opencv_python
15
+ opencv_python_headless
16
+ peft
17
+ Pillow
18
+ pygltflib
19
+ pymeshlab>=2023.12
20
+ rembg[gpu]
21
+ torch>=2.0.1
22
+ torch_scatter @ https://data.pyg.org/whl/torch-2.2.0%2Bcu121/torch_scatter-2.1.2%2Bpt22cu121-cp310-cp310-linux_x86_64.whl
23
+ tqdm
24
+ transformers
25
+ trimesh
26
+ typeguard
27
+ wandb
28
+ xformers
29
+ ninja