Spaces:
Running
on
Zero
Running
on
Zero
lemonaddie
commited on
Commit
•
93b7099
1
Parent(s):
0243d32
Update app1.py
Browse files
app1.py
CHANGED
@@ -20,10 +20,10 @@ def process(
|
|
20 |
denoise_steps,
|
21 |
processing_res,
|
22 |
domain,
|
23 |
-
|
24 |
path_out_fp32=None,
|
25 |
path_out_vis=None,
|
26 |
-
|
27 |
):
|
28 |
if path_out_vis is not None:
|
29 |
return (
|
@@ -45,6 +45,7 @@ def process(
|
|
45 |
|
46 |
depth_pred = pipe_out.depth_np
|
47 |
depth_colored = pipe_out.depth_colored
|
|
|
48 |
depth_16bit = (depth_pred * 65535.0).astype(np.uint16)
|
49 |
|
50 |
path_output_dir = os.path.splitext(path_input)[0] + "_output"
|
@@ -52,7 +53,7 @@ def process(
|
|
52 |
|
53 |
name_base = os.path.splitext(os.path.basename(path_input))[0]
|
54 |
path_out_fp32 = os.path.join(path_output_dir, f"{name_base}_depth_fp32.npy")
|
55 |
-
|
56 |
path_out_vis = os.path.join(path_output_dir, f"{name_base}_depth_colored.png")
|
57 |
|
58 |
np.save(path_out_fp32, depth_pred)
|
@@ -60,8 +61,8 @@ def process(
|
|
60 |
depth_colored.save(path_out_vis)
|
61 |
|
62 |
return (
|
63 |
-
[
|
64 |
-
[
|
65 |
)
|
66 |
|
67 |
|
|
|
20 |
denoise_steps,
|
21 |
processing_res,
|
22 |
domain,
|
23 |
+
normal_out_vis=None,
|
24 |
path_out_fp32=None,
|
25 |
path_out_vis=None,
|
26 |
+
|
27 |
):
|
28 |
if path_out_vis is not None:
|
29 |
return (
|
|
|
45 |
|
46 |
depth_pred = pipe_out.depth_np
|
47 |
depth_colored = pipe_out.depth_colored
|
48 |
+
normal_colored = pipe_out.normal_colored
|
49 |
depth_16bit = (depth_pred * 65535.0).astype(np.uint16)
|
50 |
|
51 |
path_output_dir = os.path.splitext(path_input)[0] + "_output"
|
|
|
53 |
|
54 |
name_base = os.path.splitext(os.path.basename(path_input))[0]
|
55 |
path_out_fp32 = os.path.join(path_output_dir, f"{name_base}_depth_fp32.npy")
|
56 |
+
normal_out_vis = os.path.join(path_output_dir, f"{name_base}_normal_colored.png")
|
57 |
path_out_vis = os.path.join(path_output_dir, f"{name_base}_depth_colored.png")
|
58 |
|
59 |
np.save(path_out_fp32, depth_pred)
|
|
|
61 |
depth_colored.save(path_out_vis)
|
62 |
|
63 |
return (
|
64 |
+
[normal_out_vis, path_out_vis],
|
65 |
+
[normal_out_vis, path_out_fp32, path_out_vis],
|
66 |
)
|
67 |
|
68 |
|