Spaces:
Sleeping
Sleeping
Update gradio_app/gradio_3dgen.py
Browse files- gradio_app/gradio_3dgen.py +10 -10
gradio_app/gradio_3dgen.py
CHANGED
@@ -8,7 +8,6 @@ from gradio_app.custom_models.mvimg_prediction import run_mvprediction
|
|
8 |
from gradio_app.custom_models.normal_prediction import predict_normals
|
9 |
from scripts.refine_lr_to_sr import run_sr_fast
|
10 |
from scripts.utils import save_glb_and_video
|
11 |
-
# from scripts.multiview_inference import geo_reconstruct
|
12 |
from scripts.multiview_inference import geo_reconstruct_part1, geo_reconstruct_part2, geo_reconstruct_part3
|
13 |
|
14 |
@spaces.GPU(duration=100)
|
@@ -40,6 +39,7 @@ 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 |
def create_ui(concurrency_id="wkl"):
|
45 |
with gr.Row():
|
@@ -58,24 +58,24 @@ def create_ui(concurrency_id="wkl"):
|
|
58 |
|
59 |
|
60 |
with gr.Column(scale=1):
|
61 |
-
#
|
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=
|
64 |
|
65 |
input_processing = gr.Checkbox(
|
66 |
value=True,
|
67 |
label='Remove Background',
|
68 |
visible=True,
|
69 |
)
|
70 |
-
do_refine = gr.Checkbox(value=True, label="Refine Multiview Details", visible=
|
71 |
-
expansion_weight = gr.Slider(minimum=-1., maximum=1.0, value=0.1, step=0.1, label="Expansion Weight", visible=
|
72 |
-
init_type = gr.Dropdown(choices=["std", "thin"], label="Mesh Initialization", value="std", visible=
|
73 |
-
setable_seed = gr.Slider(-1, 1000000000, -1, step=1, visible=True, label="Seed")
|
74 |
-
render_video = gr.Checkbox(value=False, visible=
|
75 |
-
fullrunv2_btn = gr.Button('Generate 3D', variant
|
76 |
|
77 |
fullrunv2_btn.click(
|
78 |
-
fn
|
79 |
inputs=[input_image, input_processing, setable_seed, render_video, do_refine, expansion_weight, init_type],
|
80 |
outputs=[output_mesh, output_video],
|
81 |
concurrency_id=concurrency_id,
|
|
|
8 |
from gradio_app.custom_models.normal_prediction import predict_normals
|
9 |
from scripts.refine_lr_to_sr import run_sr_fast
|
10 |
from scripts.utils import save_glb_and_video
|
|
|
11 |
from scripts.multiview_inference import geo_reconstruct_part1, geo_reconstruct_part2, geo_reconstruct_part3
|
12 |
|
13 |
@spaces.GPU(duration=100)
|
|
|
39 |
|
40 |
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)
|
41 |
return ret_mesh, video
|
42 |
+
|
43 |
#######################################
|
44 |
def create_ui(concurrency_id="wkl"):
|
45 |
with gr.Row():
|
|
|
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 (360° Video)", show_label=True, show_share_button=True, height=320, visible=True) # Habilitado
|
64 |
|
65 |
input_processing = gr.Checkbox(
|
66 |
value=True,
|
67 |
label='Remove Background',
|
68 |
visible=True,
|
69 |
)
|
70 |
+
do_refine = gr.Checkbox(value=True, label="Refine Multiview Details", visible=True) # Habilitado
|
71 |
+
expansion_weight = gr.Slider(minimum=-1., maximum=1.0, value=0.1, step=0.1, label="Expansion Weight", visible=True) # Habilitado
|
72 |
+
init_type = gr.Dropdown(choices=["std", "thin"], label="Mesh Initialization", value="std", visible=True) # Habilitado
|
73 |
+
setable_seed = gr.Slider(-1, 1000000000, -1, step=1, visible=True, label="Seed") # Habilitado
|
74 |
+
render_video = gr.Checkbox(value=False, visible=True, label="Generate 360° Video") # Habilitado
|
75 |
+
fullrunv2_btn = gr.Button('Generate 3D', variant="primary", interactive=True)
|
76 |
|
77 |
fullrunv2_btn.click(
|
78 |
+
fn=generate3dv2,
|
79 |
inputs=[input_image, input_processing, setable_seed, render_video, do_refine, expansion_weight, init_type],
|
80 |
outputs=[output_mesh, output_video],
|
81 |
concurrency_id=concurrency_id,
|