Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -177,8 +177,12 @@ with gr.Blocks() as demo:
|
|
177 |
feature_visibility = choice == "Neural Network"
|
178 |
return [gr.update(visible=image_visibility)] + [gr.update(visible=feature_visibility)] * len(feature_inputs)
|
179 |
|
180 |
-
model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs])
|
181 |
-
|
|
|
|
|
|
|
|
|
182 |
example_btn_1.click(lambda: fill_example(benign_example), None, feature_inputs)
|
183 |
example_btn_2.click(lambda: fill_example(malignant_example), None, feature_inputs)
|
184 |
|
|
|
177 |
feature_visibility = choice == "Neural Network"
|
178 |
return [gr.update(visible=image_visibility)] + [gr.update(visible=feature_visibility)] * len(feature_inputs)
|
179 |
|
180 |
+
# model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs])
|
181 |
+
model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs, file_input])
|
182 |
+
# Bind image preview buttons to update image_input
|
183 |
+
for btn, img_path in example_buttons:
|
184 |
+
btn.click(lambda p=img_path: Image.open(p), outputs=image_input)
|
185 |
+
|
186 |
example_btn_1.click(lambda: fill_example(benign_example), None, feature_inputs)
|
187 |
example_btn_2.click(lambda: fill_example(malignant_example), None, feature_inputs)
|
188 |
|