Spaces:
Runtime error
Runtime error
Zhyever
commited on
Commit
·
ddf200b
1
Parent(s):
484131e
scale depth by 65535/maxdepth
Browse files
app.py
CHANGED
|
@@ -175,7 +175,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 175 |
with gr.Row():
|
| 176 |
depth_image_slider = ImageSlider(label="Depth Map with Slider View", elem_id='img-display-output', position=0.5)
|
| 177 |
|
| 178 |
-
raw_file = gr.File(label="16-Bit Raw Depth, Multiplier:
|
| 179 |
submit = gr.Button("Submit")
|
| 180 |
|
| 181 |
def on_submit(image, mode, patch_number, resolution_h, resolution_w, patch_split_number_h, patch_split_number_w, color_map):
|
|
@@ -202,7 +202,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 202 |
pf_prediction_colored = colorize_depth(pf_prediction, cmap=color_map)
|
| 203 |
coarse_predictioncolored = colorize_depth(coarse_prediction, cmap=color_map)
|
| 204 |
|
| 205 |
-
|
|
|
|
| 206 |
tmp = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
| 207 |
raw_depth.save(tmp.name)
|
| 208 |
|
|
|
|
| 175 |
with gr.Row():
|
| 176 |
depth_image_slider = ImageSlider(label="Depth Map with Slider View", elem_id='img-display-output', position=0.5)
|
| 177 |
|
| 178 |
+
raw_file = gr.File(label="16-Bit Raw Depth, Multiplier:65535/80")
|
| 179 |
submit = gr.Button("Submit")
|
| 180 |
|
| 181 |
def on_submit(image, mode, patch_number, resolution_h, resolution_w, patch_split_number_h, patch_split_number_w, color_map):
|
|
|
|
| 202 |
pf_prediction_colored = colorize_depth(pf_prediction, cmap=color_map)
|
| 203 |
coarse_predictioncolored = colorize_depth(coarse_prediction, cmap=color_map)
|
| 204 |
|
| 205 |
+
max_depth = 80
|
| 206 |
+
raw_depth = Image.fromarray((pf_prediction*(65535 / max_depth)).astype('uint16'))
|
| 207 |
tmp = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
| 208 |
raw_depth.save(tmp.name)
|
| 209 |
|