Update app.py
Browse files
app.py
CHANGED
@@ -102,9 +102,10 @@ with gr.Blocks(css=css) as demo:
|
|
102 |
|
103 |
with gr.Row():
|
104 |
input_image = gr.Image(label="Input Image", type='numpy', elem_id='img-display-input')
|
105 |
-
dis_image_slider =
|
|
|
106 |
submit = gr.Button(value="Compute")
|
107 |
-
raw_file = gr.File(label="16-bit raw output
|
108 |
|
109 |
def on_submit(image):
|
110 |
original_image = image.copy()
|
@@ -115,7 +116,8 @@ with gr.Blocks(css=css) as demo:
|
|
115 |
tmp_raw_DIS_map = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
116 |
raw_DIS_map.save(tmp_raw_DIS_map.name)
|
117 |
|
118 |
-
return [[original_image, DIS_map.astype(np.uint8)], tmp_raw_DIS_map.name]
|
|
|
119 |
|
120 |
submit.click(on_submit, inputs=[input_image], outputs=[dis_image_slider, raw_file])
|
121 |
|
|
|
102 |
|
103 |
with gr.Row():
|
104 |
input_image = gr.Image(label="Input Image", type='numpy', elem_id='img-display-input')
|
105 |
+
dis_image_slider = gr.Image(label="Pedict View", type='numpy', elem_id='img-display-input')
|
106 |
+
# dis_image_slider = ImageSlider(label="Pedict View", elem_id='img-display-output', position=0.5)
|
107 |
submit = gr.Button(value="Compute")
|
108 |
+
raw_file = gr.File(label="16-bit raw output", elem_id="download",)
|
109 |
|
110 |
def on_submit(image):
|
111 |
original_image = image.copy()
|
|
|
116 |
tmp_raw_DIS_map = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
|
117 |
raw_DIS_map.save(tmp_raw_DIS_map.name)
|
118 |
|
119 |
+
# return [[original_image, DIS_map.astype(np.uint8)], tmp_raw_DIS_map.name]
|
120 |
+
return [DIS_map.astype(np.uint8), tmp_raw_DIS_map.name]
|
121 |
|
122 |
submit.click(on_submit, inputs=[input_image], outputs=[dis_image_slider, raw_file])
|
123 |
|