Spaces:
Sleeping
Sleeping
change output type
Browse files
app.py
CHANGED
@@ -229,30 +229,39 @@ def preprocess_image(image, output_size=(300, 300)):
|
|
229 |
def update_display(image):
|
230 |
processed_image = preprocess_image(image)
|
231 |
instruction = "Image ready. Please switch to the 'Specimen Workbench' tab to check out further analysis and outputs."
|
232 |
-
model_name =
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
-
top_k =
|
|
|
252 |
class_predicted = "Class Predicted" # gr.Label(label='Class Predicted',num_top_classes=10)
|
253 |
-
exp_gallery =
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
256 |
return processed_image,processed_image,instruction,model_name,explain_method,sampling_size,top_k,exp_gallery,closest_gallery,diagram
|
257 |
def update_slider_visibility(explain_method):
|
258 |
bool = explain_method=="Rise"
|
|
|
229 |
def update_display(image):
|
230 |
processed_image = preprocess_image(image)
|
231 |
instruction = "Image ready. Please switch to the 'Specimen Workbench' tab to check out further analysis and outputs."
|
232 |
+
model_name = "Fossils new"
|
233 |
+
|
234 |
+
# gr.Dropdown(
|
235 |
+
# ["Mummified 170", "Rock 170","Fossils 142","Fossils new"],
|
236 |
+
# multiselect=False,
|
237 |
+
# value="Fossils new", # default option
|
238 |
+
# label="Model",
|
239 |
+
# interactive=True,
|
240 |
+
# info="Choose the model you'd like to use"
|
241 |
+
# )
|
242 |
+
explain_method = "Rise"
|
243 |
+
|
244 |
+
# gr.Dropdown(
|
245 |
+
# ["Sobol", "HSIC","Rise","Saliency"],
|
246 |
+
# multiselect=False,
|
247 |
+
# value="Rise", # default option
|
248 |
+
# label="Explain method",
|
249 |
+
# interactive=True,
|
250 |
+
# info="Choose one method to explain the model"
|
251 |
+
# )
|
252 |
+
sampling_size = 2000
|
253 |
+
# gr.Slider(1, 5000, value=2000, label="Sampling Size in Rise",interactive=True,visible=True,
|
254 |
+
# info="Choose between 1 and 5000")
|
255 |
|
256 |
+
top_k = 50
|
257 |
+
# gr.Slider(10,200,value=50,label="Number of Closest Samples for Distribution Chart",interactive=True,info="Choose between 10 and 200")
|
258 |
class_predicted = "Class Predicted" # gr.Label(label='Class Predicted',num_top_classes=10)
|
259 |
+
exp_gallery = []
|
260 |
+
# gr.Gallery(label="Explanation Heatmaps for top 5 predicted classes", show_label=False,elem_id="gallery",columns=[5], rows=[1],height='auto', allow_preview=True, preview=None)
|
261 |
+
closest_gallery = []
|
262 |
+
# gr.Gallery(label="Closest Images", show_label=False,elem_id="gallery",columns=[5], rows=[1],height='auto', allow_preview=True, preview=None)
|
263 |
+
diagram= ""
|
264 |
+
# gr.Image(label = 'Bar Chart')
|
265 |
return processed_image,processed_image,instruction,model_name,explain_method,sampling_size,top_k,exp_gallery,closest_gallery,diagram
|
266 |
def update_slider_visibility(explain_method):
|
267 |
bool = explain_method=="Rise"
|