Spaces:
Running
on
Zero
Running
on
Zero
feat: when generate_mesh & generate_video, show planes too
Browse files
app.py
CHANGED
@@ -232,11 +232,11 @@ def step_1_generate_planes(image):
|
|
232 |
|
233 |
def step_2_generate_obj(image):
|
234 |
_, mesh_path = generate_mesh(image, export_mesh=True)
|
235 |
-
return mesh_path, mesh_path
|
236 |
|
237 |
def step_3_generate_video(image):
|
238 |
_, video_path = generate_mesh(image, export_video=True)
|
239 |
-
return video_path
|
240 |
|
241 |
# 从 assets 文件夹中设置示例文件,并限制最多读取 10 个文件
|
242 |
example_folder = "assets"
|
@@ -296,8 +296,8 @@ with gr.Blocks() as demo:
|
|
296 |
|
297 |
# 然后生成模型和视频
|
298 |
generate_planes_button.click(step_1_generate_planes, inputs=img_input, outputs=planes_output)
|
299 |
-
generate_mesh_button.click(step_2_generate_obj, inputs=img_input, outputs=[obj_file_output, model_output])
|
300 |
-
generate_video_button.click(step_3_generate_video, inputs=img_input, outputs=video_file_output)
|
301 |
|
302 |
demo.launch(
|
303 |
auth=(os.environ.get('AUTH_USERNAME'), os.environ.get('AUTH_PASSWORD'))
|
|
|
232 |
|
233 |
def step_2_generate_obj(image):
|
234 |
_, mesh_path = generate_mesh(image, export_mesh=True)
|
235 |
+
return planes_path.shape, mesh_path, mesh_path
|
236 |
|
237 |
def step_3_generate_video(image):
|
238 |
_, video_path = generate_mesh(image, export_video=True)
|
239 |
+
return planes_path.shape, video_path
|
240 |
|
241 |
# 从 assets 文件夹中设置示例文件,并限制最多读取 10 个文件
|
242 |
example_folder = "assets"
|
|
|
296 |
|
297 |
# 然后生成模型和视频
|
298 |
generate_planes_button.click(step_1_generate_planes, inputs=img_input, outputs=planes_output)
|
299 |
+
generate_mesh_button.click(step_2_generate_obj, inputs=img_input, outputs=[planes_output, obj_file_output, model_output])
|
300 |
+
generate_video_button.click(step_3_generate_video, inputs=img_input, outputs=[planes_output, video_file_output])
|
301 |
|
302 |
demo.launch(
|
303 |
auth=(os.environ.get('AUTH_USERNAME'), os.environ.get('AUTH_PASSWORD'))
|