Spaces:
Runtime error
Runtime error
wip
Browse files
app.py
CHANGED
@@ -116,11 +116,11 @@ def generate_3D(input, model_name='base1B', guidance_scale=3.0, grid_size=128):
|
|
116 |
pc = sampler.output_to_point_clouds(samples)[0]
|
117 |
|
118 |
set_state('Converting to mesh...')
|
119 |
-
save_ply(pc, '/tmp/mesh.ply'
|
120 |
|
121 |
set_state('')
|
122 |
|
123 |
-
return
|
124 |
|
125 |
def prepare_img(img):
|
126 |
|
@@ -257,6 +257,7 @@ with block:
|
|
257 |
|
258 |
with gr.Column():
|
259 |
model_gif = gr.Video(label="3D Model GIF")
|
|
|
260 |
# btn_pc_to_obj = gr.Button(value="Convert to OBJ", visible=False)
|
261 |
file_out = gr.File(label="Files", visible=False)
|
262 |
|
@@ -267,7 +268,7 @@ with block:
|
|
267 |
["images/fantasy_world.png"],
|
268 |
],
|
269 |
inputs=[input_image],
|
270 |
-
outputs=[model_gif, file_out],
|
271 |
fn=generate_3D,
|
272 |
cache_examples=True
|
273 |
)
|
|
|
116 |
pc = sampler.output_to_point_clouds(samples)[0]
|
117 |
|
118 |
set_state('Converting to mesh...')
|
119 |
+
save_ply(pc, '/tmp/mesh.ply')
|
120 |
|
121 |
set_state('')
|
122 |
|
123 |
+
return pc, create_gif(pc), gr.update(value=['/tmp/mesh.ply'], visible=True)
|
124 |
|
125 |
def prepare_img(img):
|
126 |
|
|
|
257 |
|
258 |
with gr.Column():
|
259 |
model_gif = gr.Video(label="3D Model GIF")
|
260 |
+
model_3d = gr.Model3D(value=None)
|
261 |
# btn_pc_to_obj = gr.Button(value="Convert to OBJ", visible=False)
|
262 |
file_out = gr.File(label="Files", visible=False)
|
263 |
|
|
|
268 |
["images/fantasy_world.png"],
|
269 |
],
|
270 |
inputs=[input_image],
|
271 |
+
outputs=[model_3d, model_gif, file_out],
|
272 |
fn=generate_3D,
|
273 |
cache_examples=True
|
274 |
)
|