Spaces:
Paused
Paused
sds
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ def create_from_text(prompt):
|
|
| 30 |
subprocess.run(cmd1)
|
| 31 |
subprocess.run(cmd2)
|
| 32 |
glb_path = convert_obj_to_glb(f"{temp_dir}/{sanitized_prompt}.obj", temp_dir)
|
| 33 |
-
return get_html_model(glb_path)
|
| 34 |
|
| 35 |
def create_from_image(image):
|
| 36 |
temp_dir = tempfile.mkdtemp()
|
|
@@ -65,7 +65,7 @@ def create_from_image(image):
|
|
| 65 |
subprocess.run(cmd2)
|
| 66 |
subprocess.run(cmd3)
|
| 67 |
glb_path = convert_obj_to_glb(f"{temp_dir}/{sanitized_prompt}.obj", temp_dir)
|
| 68 |
-
return get_html_model(glb_path)
|
| 69 |
|
| 70 |
|
| 71 |
def convert_obj_to_glb(obj_path, out_path):
|
|
@@ -105,7 +105,8 @@ source: https://github.com/dreamgaussian/dreamgaussian
|
|
| 105 |
btn = gr.Button("Generate")
|
| 106 |
with gr.Column():
|
| 107 |
model_3d = gr.HTML(label="Model 3D", show_label=True)
|
| 108 |
-
|
|
|
|
| 109 |
clear.click(lambda x: (gr.update(value=None),gr.update(value=None)), None, [prompt, image], queue=False)
|
| 110 |
|
| 111 |
demo.queue(api_open=False, concurrency_count=1)
|
|
|
|
| 30 |
subprocess.run(cmd1)
|
| 31 |
subprocess.run(cmd2)
|
| 32 |
glb_path = convert_obj_to_glb(f"{temp_dir}/{sanitized_prompt}.obj", temp_dir)
|
| 33 |
+
return get_html_model(glb_path), glb_path
|
| 34 |
|
| 35 |
def create_from_image(image):
|
| 36 |
temp_dir = tempfile.mkdtemp()
|
|
|
|
| 65 |
subprocess.run(cmd2)
|
| 66 |
subprocess.run(cmd3)
|
| 67 |
glb_path = convert_obj_to_glb(f"{temp_dir}/{sanitized_prompt}.obj", temp_dir)
|
| 68 |
+
return get_html_model(glb_path), glb_path
|
| 69 |
|
| 70 |
|
| 71 |
def convert_obj_to_glb(obj_path, out_path):
|
|
|
|
| 105 |
btn = gr.Button("Generate")
|
| 106 |
with gr.Column():
|
| 107 |
model_3d = gr.HTML(label="Model 3D", show_label=True)
|
| 108 |
+
file = gr.File()
|
| 109 |
+
btn.click(generate, inputs=[prompt, image], outputs=[model_3d, file])
|
| 110 |
clear.click(lambda x: (gr.update(value=None),gr.update(value=None)), None, [prompt, image], queue=False)
|
| 111 |
|
| 112 |
demo.queue(api_open=False, concurrency_count=1)
|