Spaces:
Runtime error
Runtime error
Update gradio_app/gradio_3dgen.py
Browse files- gradio_app/gradio_3dgen.py +4 -24
gradio_app/gradio_3dgen.py
CHANGED
|
@@ -40,33 +40,12 @@ def generate3dv2(preview_img, input_processing, seed, render_video=True, do_refi
|
|
| 40 |
|
| 41 |
ret_mesh, video = save_glb_and_video("/tmp/gradio/generated", new_meshes, with_timestamp=True, dist=3.5, fov_in_degrees=2 / 1.35, cam_type="ortho", export_video=render_video)
|
| 42 |
return ret_mesh, video
|
| 43 |
-
|
| 44 |
#######################################
|
| 45 |
def create_ui(concurrency_id="wkl"):
|
| 46 |
with gr.Row():
|
| 47 |
with gr.Column(scale=1):
|
| 48 |
-
# Mensaje de agradecimiento para @hysts
|
| 49 |
-
gr.Markdown("""
|
| 50 |
-
### Special Thanks
|
| 51 |
-
A big thank you to [@hysts](https://huggingface.co/hysts) for their help in making the "Duplicate this Space" feature work correctly!
|
| 52 |
-
""")
|
| 53 |
-
|
| 54 |
-
# Bot贸n "Duplicate this Space"
|
| 55 |
-
gr.HTML("""
|
| 56 |
-
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;">
|
| 57 |
-
<p style="display: flex; gap: 6px;">
|
| 58 |
-
<a href="https://huggingface.co/spaces/cavargas10/Unico3D?duplicate=true">
|
| 59 |
-
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-lg.svg" alt="Duplicate this Space">
|
| 60 |
-
</a>
|
| 61 |
-
</p>
|
| 62 |
-
<p>to skip the queue and enjoy faster inference on the GPU of your choice</p>
|
| 63 |
-
</div>
|
| 64 |
-
""")
|
| 65 |
-
|
| 66 |
-
# Campo para ingresar la imagen
|
| 67 |
input_image = gr.Image(type='pil', image_mode='RGBA', label='Frontview')
|
| 68 |
|
| 69 |
-
# Ejemplos
|
| 70 |
example_folder = os.path.join(os.path.dirname(__file__), "./examples")
|
| 71 |
example_fns = sorted([os.path.join(example_folder, example) for example in os.listdir(example_folder)])
|
| 72 |
gr.Examples(
|
|
@@ -76,9 +55,10 @@ def create_ui(concurrency_id="wkl"):
|
|
| 76 |
label='Examples',
|
| 77 |
examples_per_page=12
|
| 78 |
)
|
| 79 |
-
|
|
|
|
| 80 |
with gr.Column(scale=1):
|
| 81 |
-
#
|
| 82 |
output_mesh = gr.Model3D(value=None, label="Mesh Model", show_label=True, height=320, camera_position=(90, 90, 2))
|
| 83 |
output_video = gr.Video(label="Preview", show_label=True, show_share_button=True, height=320, visible=False)
|
| 84 |
|
|
@@ -101,4 +81,4 @@ def create_ui(concurrency_id="wkl"):
|
|
| 101 |
concurrency_id=concurrency_id,
|
| 102 |
api_name="generate3dv2",
|
| 103 |
).success(clean_up, api_name=False)
|
| 104 |
-
return input_image
|
|
|
|
| 40 |
|
| 41 |
ret_mesh, video = save_glb_and_video("/tmp/gradio/generated", new_meshes, with_timestamp=True, dist=3.5, fov_in_degrees=2 / 1.35, cam_type="ortho", export_video=render_video)
|
| 42 |
return ret_mesh, video
|
|
|
|
| 43 |
#######################################
|
| 44 |
def create_ui(concurrency_id="wkl"):
|
| 45 |
with gr.Row():
|
| 46 |
with gr.Column(scale=1):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
input_image = gr.Image(type='pil', image_mode='RGBA', label='Frontview')
|
| 48 |
|
|
|
|
| 49 |
example_folder = os.path.join(os.path.dirname(__file__), "./examples")
|
| 50 |
example_fns = sorted([os.path.join(example_folder, example) for example in os.listdir(example_folder)])
|
| 51 |
gr.Examples(
|
|
|
|
| 55 |
label='Examples',
|
| 56 |
examples_per_page=12
|
| 57 |
)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
with gr.Column(scale=1):
|
| 61 |
+
# export mesh display
|
| 62 |
output_mesh = gr.Model3D(value=None, label="Mesh Model", show_label=True, height=320, camera_position=(90, 90, 2))
|
| 63 |
output_video = gr.Video(label="Preview", show_label=True, show_share_button=True, height=320, visible=False)
|
| 64 |
|
|
|
|
| 81 |
concurrency_id=concurrency_id,
|
| 82 |
api_name="generate3dv2",
|
| 83 |
).success(clean_up, api_name=False)
|
| 84 |
+
return input_image
|