Spaces:
Running
on
Zero
Running
on
Zero
guangkaixu
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,8 @@ def process_image(
|
|
67 |
print(f"Processing image {name_base}{name_ext}")
|
68 |
|
69 |
path_output_dir = tempfile.mkdtemp()
|
70 |
-
path_out_fp32 = os.path.join(path_output_dir, f"{name_base}
|
71 |
-
path_out_vis = os.path.join(path_output_dir, f"{name_base}
|
72 |
|
73 |
input_image = Image.open(path_input)
|
74 |
|
@@ -87,7 +87,7 @@ def process_image(
|
|
87 |
depth_colored.save(path_out_vis)
|
88 |
|
89 |
if mode == 'depth':
|
90 |
-
path_out_16bit = os.path.join(path_output_dir, f"{name_base}
|
91 |
depth_16bit = (depth_pred * 65535.0).astype(np.uint16)
|
92 |
Image.fromarray(depth_16bit).save(path_out_16bit, mode="I;16")
|
93 |
else:
|
|
|
67 |
print(f"Processing image {name_base}{name_ext}")
|
68 |
|
69 |
path_output_dir = tempfile.mkdtemp()
|
70 |
+
path_out_fp32 = os.path.join(path_output_dir, f"{name_base}_%s_fp32.npy" %mode)
|
71 |
+
path_out_vis = os.path.join(path_output_dir, f"{name_base}_%s_colored.png" %mode)
|
72 |
|
73 |
input_image = Image.open(path_input)
|
74 |
|
|
|
87 |
depth_colored.save(path_out_vis)
|
88 |
|
89 |
if mode == 'depth':
|
90 |
+
path_out_16bit = os.path.join(path_output_dir, f"{name_base}_%s_16bit.png" %mode)
|
91 |
depth_16bit = (depth_pred * 65535.0).astype(np.uint16)
|
92 |
Image.fromarray(depth_16bit).save(path_out_16bit, mode="I;16")
|
93 |
else:
|