Spaces:
Runtime error
Runtime error
lemonaddie
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -157,7 +157,7 @@ def run_demo_server(pipe):
|
|
157 |
render=False,
|
158 |
)
|
159 |
|
160 |
-
demo_3d = gr.Row(render=False)
|
161 |
# with demo_3d:
|
162 |
# with gr.Column():
|
163 |
# with gr.Accordion("3D printing demo: Main options", open=True):
|
@@ -255,47 +255,47 @@ def run_demo_server(pipe):
|
|
255 |
# interactive=False,
|
256 |
# )
|
257 |
|
258 |
-
blocks_settings_depth = [ensemble_size, denoise_steps, processing_res]
|
259 |
-
blocks_settings_3d = [plane_near, plane_far, embossing, size_longest_px, size_longest_cm, filter_size,
|
260 |
-
|
261 |
-
blocks_settings = blocks_settings_depth + blocks_settings_3d
|
262 |
-
map_id_to_default = {b._id: b.value for b in blocks_settings}
|
263 |
-
|
264 |
-
inputs = [
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
]
|
278 |
-
outputs = [
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
]
|
284 |
-
|
285 |
-
def submit_depth_fn(*args):
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
submit_btn.click(
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
)
|
296 |
-
|
297 |
-
demo_3d_header.render()
|
298 |
-
demo_3d.render()
|
299 |
|
300 |
def clear_fn():
|
301 |
out = []
|
@@ -314,50 +314,50 @@ def run_demo_server(pipe):
|
|
314 |
inputs=[],
|
315 |
outputs=blocks_settings + [
|
316 |
submit_btn,
|
317 |
-
submit_3d,
|
318 |
input_image,
|
319 |
input_output_16bit,
|
320 |
input_output_fp32,
|
321 |
input_output_vis,
|
322 |
output_slider,
|
323 |
files,
|
324 |
-
viewer_3d,
|
325 |
-
files_3d,
|
326 |
-
],
|
327 |
-
)
|
328 |
-
|
329 |
-
def submit_3d_fn(*args):
|
330 |
-
out = list(process_3d(*args))
|
331 |
-
out = [gr.Button(interactive=False)] + out
|
332 |
-
return out
|
333 |
-
|
334 |
-
submit_3d.click(
|
335 |
-
fn=submit_3d_fn,
|
336 |
-
inputs=[
|
337 |
-
input_image,
|
338 |
-
files,
|
339 |
-
size_longest_px,
|
340 |
-
size_longest_cm,
|
341 |
-
filter_size,
|
342 |
-
plane_near,
|
343 |
-
plane_far,
|
344 |
-
embossing,
|
345 |
-
frame_thickness,
|
346 |
-
frame_near,
|
347 |
-
frame_far,
|
348 |
],
|
349 |
-
outputs=[submit_3d, viewer_3d, files_3d],
|
350 |
-
concurrency_limit=1,
|
351 |
)
|
352 |
|
353 |
-
def
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
|
362 |
demo.queue(
|
363 |
api_open=False,
|
|
|
157 |
render=False,
|
158 |
)
|
159 |
|
160 |
+
#demo_3d = gr.Row(render=False)
|
161 |
# with demo_3d:
|
162 |
# with gr.Column():
|
163 |
# with gr.Accordion("3D printing demo: Main options", open=True):
|
|
|
255 |
# interactive=False,
|
256 |
# )
|
257 |
|
258 |
+
# blocks_settings_depth = [ensemble_size, denoise_steps, processing_res]
|
259 |
+
# # blocks_settings_3d = [plane_near, plane_far, embossing, size_longest_px, size_longest_cm, filter_size,
|
260 |
+
# # frame_thickness, frame_near, frame_far]
|
261 |
+
# # blocks_settings = blocks_settings_depth + blocks_settings_3d
|
262 |
+
# map_id_to_default = {b._id: b.value for b in blocks_settings}
|
263 |
+
|
264 |
+
# inputs = [
|
265 |
+
# input_image,
|
266 |
+
# ensemble_size,
|
267 |
+
# denoise_steps,
|
268 |
+
# processing_res,
|
269 |
+
# input_output_16bit,
|
270 |
+
# input_output_fp32,
|
271 |
+
# input_output_vis,
|
272 |
+
# plane_near,
|
273 |
+
# plane_far,
|
274 |
+
# embossing,
|
275 |
+
# filter_size,
|
276 |
+
# frame_near,
|
277 |
+
# ]
|
278 |
+
# outputs = [
|
279 |
+
# submit_btn,
|
280 |
+
# input_image,
|
281 |
+
# output_slider,
|
282 |
+
# files,
|
283 |
+
# ]
|
284 |
+
|
285 |
+
# def submit_depth_fn(*args):
|
286 |
+
# out = list(process_pipe(*args))
|
287 |
+
# out = [gr.Button(interactive=False), gr.Image(interactive=False)] + out
|
288 |
+
# return out
|
289 |
+
|
290 |
+
# submit_btn.click(
|
291 |
+
# fn=submit_depth_fn,
|
292 |
+
# inputs=inputs,
|
293 |
+
# outputs=outputs,
|
294 |
+
# concurrency_limit=1,
|
295 |
+
# )
|
296 |
+
|
297 |
+
# demo_3d_header.render()
|
298 |
+
# demo_3d.render()
|
299 |
|
300 |
def clear_fn():
|
301 |
out = []
|
|
|
314 |
inputs=[],
|
315 |
outputs=blocks_settings + [
|
316 |
submit_btn,
|
317 |
+
#submit_3d,
|
318 |
input_image,
|
319 |
input_output_16bit,
|
320 |
input_output_fp32,
|
321 |
input_output_vis,
|
322 |
output_slider,
|
323 |
files,
|
324 |
+
#viewer_3d,
|
325 |
+
#files_3d,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
],
|
|
|
|
|
327 |
)
|
328 |
|
329 |
+
# def submit_3d_fn(*args):
|
330 |
+
# out = list(process_3d(*args))
|
331 |
+
# out = [gr.Button(interactive=False)] + out
|
332 |
+
# return out
|
333 |
+
|
334 |
+
# submit_3d.click(
|
335 |
+
# fn=submit_3d_fn,
|
336 |
+
# inputs=[
|
337 |
+
# input_image,
|
338 |
+
# files,
|
339 |
+
# size_longest_px,
|
340 |
+
# size_longest_cm,
|
341 |
+
# filter_size,
|
342 |
+
# plane_near,
|
343 |
+
# plane_far,
|
344 |
+
# embossing,
|
345 |
+
# frame_thickness,
|
346 |
+
# frame_near,
|
347 |
+
# frame_far,
|
348 |
+
# ],
|
349 |
+
# outputs=[submit_3d, viewer_3d, files_3d],
|
350 |
+
# concurrency_limit=1,
|
351 |
+
# )
|
352 |
+
|
353 |
+
# def clear_3d_fn():
|
354 |
+
# return [gr.Button(interactive=True), None, None]
|
355 |
+
|
356 |
+
# clear_3d.click(
|
357 |
+
# fn=clear_3d_fn,
|
358 |
+
# inputs=[],
|
359 |
+
# outputs=[submit_3d, viewer_3d, files_3d],
|
360 |
+
# )
|
361 |
|
362 |
demo.queue(
|
363 |
api_open=False,
|