Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,35 +60,6 @@ def process(
|
|
60 |
[path_out_16bit, path_out_fp32, path_out_vis],
|
61 |
)
|
62 |
|
63 |
-
|
64 |
-
def process_3d(
|
65 |
-
input_image,
|
66 |
-
files,
|
67 |
-
size_longest_px,
|
68 |
-
size_longest_cm,
|
69 |
-
filter_size,
|
70 |
-
plane_near,
|
71 |
-
plane_far,
|
72 |
-
embossing,
|
73 |
-
frame_thickness,
|
74 |
-
frame_near,
|
75 |
-
frame_far,
|
76 |
-
):
|
77 |
-
if input_image is None or len(files) < 1:
|
78 |
-
raise gr.Error("Please upload an image (or use examples) and compute depth first")
|
79 |
-
|
80 |
-
if plane_near >= plane_far:
|
81 |
-
raise gr.Error("NEAR plane must have a value smaller than the FAR plane")
|
82 |
-
|
83 |
-
# sanitize 3d viewer glb path to keep babylon.js happy
|
84 |
-
path_viewer_glb_sanitized = os.path.join(os.path.dirname(path_viewer_glb), "preview.glb")
|
85 |
-
if path_viewer_glb_sanitized != path_viewer_glb:
|
86 |
-
os.rename(path_viewer_glb, path_viewer_glb_sanitized)
|
87 |
-
path_viewer_glb = path_viewer_glb_sanitized
|
88 |
-
|
89 |
-
return path_viewer_glb, [path_files_glb, path_files_stl]
|
90 |
-
|
91 |
-
|
92 |
def run_demo_server(pipe):
|
93 |
process_pipe = functools.partial(process, pipe)
|
94 |
os.environ["GRADIO_ALLOW_FLAGGING"] = "never"
|
|
|
60 |
[path_out_16bit, path_out_fp32, path_out_vis],
|
61 |
)
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
def run_demo_server(pipe):
|
64 |
process_pipe = functools.partial(process, pipe)
|
65 |
os.environ["GRADIO_ALLOW_FLAGGING"] = "never"
|