Spaces:
Runtime error
Runtime error
PedroMartelleto
commited on
Commit
•
73a6c1b
1
Parent(s):
3290ef3
small fixes
Browse files
app.py
CHANGED
@@ -74,12 +74,11 @@ labels = [ "benign", "malignant", "normal" ]
|
|
74 |
|
75 |
def predict(img):
|
76 |
explainer = Explainer(model, img, labels)
|
77 |
-
|
78 |
-
return explainer.confidences
|
79 |
|
80 |
ui = gr.Interface(fn=predict,
|
81 |
inputs=gr.Image(type="pil"),
|
82 |
-
outputs=gr.Label(num_top_classes=3),
|
83 |
-
interpretation="shap", num_shap=5
|
84 |
examples=["benign (52).png", "benign (243).png", "malignant (127).png", "malignant (201).png", "normal (81).png", "normal (101).png"]).launch()
|
85 |
ui.launch(share=True)
|
|
|
74 |
|
75 |
def predict(img):
|
76 |
explainer = Explainer(model, img, labels)
|
77 |
+
shap_img = explainer.shap()
|
78 |
+
return [explainer.confidences, shap_img]
|
79 |
|
80 |
ui = gr.Interface(fn=predict,
|
81 |
inputs=gr.Image(type="pil"),
|
82 |
+
outputs=[gr.Label(num_top_classes=3), gr.Image(type="pil")],
|
|
|
83 |
examples=["benign (52).png", "benign (243).png", "malignant (127).png", "malignant (201).png", "normal (81).png", "normal (101).png"]).launch()
|
84 |
ui.launch(share=True)
|