Spaces:
Sleeping
Sleeping
FrozenBurning
commited on
Commit
•
0ad853d
1
Parent(s):
cb029d0
Update app.py
Browse files
app.py
CHANGED
@@ -139,7 +139,7 @@ def process(input_cond, input_num_steps, input_seed=42, input_cfg=6.0):
|
|
139 |
recon_param = torch.concat([recon_srt_param, recon_feat_param], dim=-1)
|
140 |
visualize_video_primvolume(config.output_dir, batch, recon_param, 15, rm, device)
|
141 |
prim_params = {'srt_param': recon_srt_param[0].detach().cpu(), 'feat_param': recon_feat_param[0].detach().cpu()}
|
142 |
-
return output_rgb_video_path, output_prim_video_path, output_mat_video_path,
|
143 |
|
144 |
def export_mesh(prim_params, uv_unwrap="Faster", remesh="No", mc_resolution=256, decimate=100000):
|
145 |
# exporting GLB mesh
|
@@ -247,7 +247,7 @@ with block:
|
|
247 |
)
|
248 |
|
249 |
input_image.change(background_remove_process, inputs=[input_image], outputs=[button_gen, current_fg_state, removal_previewer])
|
250 |
-
button_gen.click(process, inputs=[current_fg_state, input_num_steps, input_seed, input_cfg], outputs=[output_rgb_video, output_prim_video, output_mat_video,
|
251 |
prim_param_state.change(export_mesh, inputs=[prim_param_state, input_unwrap, input_remesh, input_mc_resolution], outputs=[output_glb, hdr_row])
|
252 |
|
253 |
gr.Examples(
|
@@ -256,7 +256,7 @@ with block:
|
|
256 |
for f in os.listdir("assets/examples")
|
257 |
],
|
258 |
inputs=[input_image],
|
259 |
-
outputs=[output_rgb_video, output_prim_video, output_mat_video,
|
260 |
fn=lambda x: process(input_image=x),
|
261 |
cache_examples=False,
|
262 |
label='Single Image to 3D PBR Asset'
|
|
|
139 |
recon_param = torch.concat([recon_srt_param, recon_feat_param], dim=-1)
|
140 |
visualize_video_primvolume(config.output_dir, batch, recon_param, 15, rm, device)
|
141 |
prim_params = {'srt_param': recon_srt_param[0].detach().cpu(), 'feat_param': recon_feat_param[0].detach().cpu()}
|
142 |
+
return output_rgb_video_path, output_prim_video_path, output_mat_video_path, prim_params
|
143 |
|
144 |
def export_mesh(prim_params, uv_unwrap="Faster", remesh="No", mc_resolution=256, decimate=100000):
|
145 |
# exporting GLB mesh
|
|
|
247 |
)
|
248 |
|
249 |
input_image.change(background_remove_process, inputs=[input_image], outputs=[button_gen, current_fg_state, removal_previewer])
|
250 |
+
button_gen.click(process, inputs=[current_fg_state, input_num_steps, input_seed, input_cfg], outputs=[output_rgb_video, output_prim_video, output_mat_video, prim_param_state])
|
251 |
prim_param_state.change(export_mesh, inputs=[prim_param_state, input_unwrap, input_remesh, input_mc_resolution], outputs=[output_glb, hdr_row])
|
252 |
|
253 |
gr.Examples(
|
|
|
256 |
for f in os.listdir("assets/examples")
|
257 |
],
|
258 |
inputs=[input_image],
|
259 |
+
outputs=[output_rgb_video, output_prim_video, output_mat_video, prim_param_state],
|
260 |
fn=lambda x: process(input_image=x),
|
261 |
cache_examples=False,
|
262 |
label='Single Image to 3D PBR Asset'
|