File size: 1,840 Bytes
684dabd
 
 
07fc356
684dabd
 
 
4c7104f
684dabd
 
 
 
 
 
 
 
07fc356
684dabd
 
07fc356
d215cd3
07fc356
684dabd
 
 
 
 
 
 
07fc356
684dabd
a3550be
684dabd
 
 
195a8d7
 
 
 
 
af5e8fe
07fc356
195a8d7
a3550be
684dabd
 
 
 
 
 
 
 
 
 
b2c6bda
684dabd
 
 
30e4c39
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import shlex
import subprocess


subprocess.run(shlex.split("pip install pip==24.0"), check=True)
subprocess.run(
    shlex.split(
        "pip install package/onnxruntime_gpu-1.17.0-cp310-cp310-manylinux_2_28_x86_64.whl --force-reinstall --no-deps"
    ), check=True
)
subprocess.run(
    shlex.split(
        "pip install package/nvdiffrast-0.3.1.torch-cp310-cp310-linux_x86_64.whl --force-reinstall --no-deps"
    ), check=True
)


if __name__ == "__main__":
    from huggingface_hub import snapshot_download

    snapshot_download("cavargas10/Unique3D", repo_type="model", local_dir="./ckpt")

    import os
    import sys
    sys.path.append(os.curdir)
    import torch
    torch.set_float32_matmul_precision('medium')
    torch.backends.cuda.matmul.allow_tf32 = True
    torch.set_grad_enabled(False)

import fire
import gradio as gr
from gradio_app.gradio_3dgen import create_ui as create_3d_ui
from gradio_app.all_models import model_zoo

_TITLE = """UTPL - Conversi贸n de Imagen a objetos 3D usando IA"""
_DESCRIPTION = """
### Tesis: *"Objetos tridimensionales creados por IA: Innovaci贸n en entornos virtuales"*  
**Autor:** Carlos Vargas  
**Base t茅cnica:** Adaptaci贸n de [Unique3D](https://wukailu.github.io/Unique3D/) (herramientas de c贸digo abierto para generaci贸n 3D)  
**Prop贸sito educativo:** Demostraciones acad茅micas e Investigaci贸n en modelado 3D autom谩tico    
**Agraecimiento especial a @hysts por su apoyo para el funcionamiento del demo**
"""

def launch():
    model_zoo.init_models()
        
    with gr.Blocks(
        title=_TITLE,
    ) as demo:
        with gr.Row():
            with gr.Column(scale=1):
                gr.Markdown('# ' + _TITLE)
        gr.Markdown(_DESCRIPTION)
        create_3d_ui("wkl") 
    demo.queue().launch(share=True)
    
if __name__ == '__main__':
    fire.Fire(launch)