Spaces:
Running
on
Zero
Running
on
Zero
display 3d models
Browse files
app.py
CHANGED
|
@@ -155,7 +155,7 @@ def process_image(input_pil, remove_bg):
|
|
| 155 |
shutil.rmtree(temp_dir) # Cleanup temporary folder
|
| 156 |
print(output_video)
|
| 157 |
torch.cuda.empty_cache()
|
| 158 |
-
return output_video[0], output_objects
|
| 159 |
|
| 160 |
css="""
|
| 161 |
div#col-container{
|
|
@@ -197,7 +197,7 @@ def gradio_interface():
|
|
| 197 |
label="Image input",
|
| 198 |
type="pil",
|
| 199 |
image_mode="RGBA",
|
| 200 |
-
height=
|
| 201 |
)
|
| 202 |
|
| 203 |
remove_bg = gr.Checkbox(label="Need to remove BG ?", value=False)
|
|
@@ -206,7 +206,9 @@ def gradio_interface():
|
|
| 206 |
|
| 207 |
with gr.Column(scale=4):
|
| 208 |
output_video= gr.Video(label="Output Video", elem_id="video-out-elm")
|
| 209 |
-
|
|
|
|
|
|
|
| 210 |
|
| 211 |
gr.Examples(
|
| 212 |
examples = examples_folder,
|
|
@@ -214,7 +216,7 @@ def gradio_interface():
|
|
| 214 |
examples_per_page = 11
|
| 215 |
)
|
| 216 |
|
| 217 |
-
submit_button.click(process_image, inputs=[input_image, remove_bg], outputs=[output_video,
|
| 218 |
|
| 219 |
return app
|
| 220 |
|
|
|
|
| 155 |
shutil.rmtree(temp_dir) # Cleanup temporary folder
|
| 156 |
print(output_video)
|
| 157 |
torch.cuda.empty_cache()
|
| 158 |
+
return output_video[0], output_objects[1], output_objects[0]
|
| 159 |
|
| 160 |
css="""
|
| 161 |
div#col-container{
|
|
|
|
| 197 |
label="Image input",
|
| 198 |
type="pil",
|
| 199 |
image_mode="RGBA",
|
| 200 |
+
height=480
|
| 201 |
)
|
| 202 |
|
| 203 |
remove_bg = gr.Checkbox(label="Need to remove BG ?", value=False)
|
|
|
|
| 206 |
|
| 207 |
with gr.Column(scale=4):
|
| 208 |
output_video= gr.Video(label="Output Video", elem_id="video-out-elm")
|
| 209 |
+
with gr.Row():
|
| 210 |
+
output_object_mesh = gr.Model3D(label=".OBJ Mesh")
|
| 211 |
+
output_object_color = gr.Model3D(label=".OBJ colored")
|
| 212 |
|
| 213 |
gr.Examples(
|
| 214 |
examples = examples_folder,
|
|
|
|
| 216 |
examples_per_page = 11
|
| 217 |
)
|
| 218 |
|
| 219 |
+
submit_button.click(process_image, inputs=[input_image, remove_bg], outputs=[output_video, output_object_mesh, output_object_color])
|
| 220 |
|
| 221 |
return app
|
| 222 |
|