change input but not show bug fix
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ def process_and_denoise(data, x_offset, y_offset, auto_contrast) -> Image:
|
|
143 |
return denoised_image
|
144 |
|
145 |
def clear_images() -> tuple:
|
146 |
-
return None, None, None, gr.update(maximum=1024), gr.update(maximum=1024)
|
147 |
|
148 |
with gr.Blocks(css="""
|
149 |
.custom-size {
|
@@ -179,13 +179,14 @@ with gr.Blocks(css="""
|
|
179 |
def load_image_and_update_sliders(file_path) -> tuple:
|
180 |
data = load_data(file_path)
|
181 |
h, w = data.shape[:2]
|
182 |
-
|
|
|
183 |
|
184 |
|
185 |
example_selector.change(
|
186 |
lambda choice:load_image_and_update_sliders(example_files[choice]),
|
187 |
inputs=example_selector,
|
188 |
-
outputs=[active_data, x_slider, y_slider]
|
189 |
)
|
190 |
|
191 |
file_input.clear(
|
@@ -197,7 +198,7 @@ with gr.Blocks(css="""
|
|
197 |
file_input.change(
|
198 |
lambda file: load_image_and_update_sliders(file.name) if file else (None, None, None, gr.update(maximum=1024), gr.update(maximum=1024)),
|
199 |
inputs=file_input,
|
200 |
-
outputs=[active_data, x_slider, y_slider]
|
201 |
)
|
202 |
|
203 |
x_slider.change(
|
|
|
143 |
return denoised_image
|
144 |
|
145 |
def clear_images() -> tuple:
|
146 |
+
return None, None, None, gr.update(value=0,maximum=1024), gr.update(value=0,maximum=1024)
|
147 |
|
148 |
with gr.Blocks(css="""
|
149 |
.custom-size {
|
|
|
179 |
def load_image_and_update_sliders(file_path) -> tuple:
|
180 |
data = load_data(file_path)
|
181 |
h, w = data.shape[:2]
|
182 |
+
original_image = display_crop(data, 0, 0, auto_contrast)
|
183 |
+
return data, original_image, None, gr.update(value=0,maximum=w-1024), gr.update(value=0,maximum=h-1024)
|
184 |
|
185 |
|
186 |
example_selector.change(
|
187 |
lambda choice:load_image_and_update_sliders(example_files[choice]),
|
188 |
inputs=example_selector,
|
189 |
+
outputs=[active_data, original_image, denoised_image, x_slider, y_slider]
|
190 |
)
|
191 |
|
192 |
file_input.clear(
|
|
|
198 |
file_input.change(
|
199 |
lambda file: load_image_and_update_sliders(file.name) if file else (None, None, None, gr.update(maximum=1024), gr.update(maximum=1024)),
|
200 |
inputs=file_input,
|
201 |
+
outputs=[active_data, original_image, denoised_image, x_slider, y_slider]
|
202 |
)
|
203 |
|
204 |
x_slider.change(
|