Update app.py
Browse files
app.py
CHANGED
@@ -29,11 +29,11 @@ def predict_pneumonia(image):
|
|
29 |
class_probabilities = model.predict(img_array)
|
30 |
|
31 |
# Return the top two possible classifications
|
32 |
-
top_classes =
|
33 |
|
34 |
# Return the class names and the confidence scores for each class
|
35 |
class_names = ["Pneumonia", "Normal"]
|
36 |
-
confidence_scores = class_probabilities
|
37 |
|
38 |
return {
|
39 |
"Pneumonia": pneumonia_prediction,
|
@@ -59,8 +59,7 @@ gradio_interface = gr.Interface(
|
|
59 |
["NORMAL2-IM-1431-0001.jpeg"]
|
60 |
],
|
61 |
theme="default",
|
62 |
-
|
63 |
)
|
64 |
|
65 |
-
|
66 |
gradio_interface.launch()
|
|
|
29 |
class_probabilities = model.predict(img_array)
|
30 |
|
31 |
# Return the top two possible classifications
|
32 |
+
top_classes = np.argsort(class_probabilities[0])[-2:]
|
33 |
|
34 |
# Return the class names and the confidence scores for each class
|
35 |
class_names = ["Pneumonia", "Normal"]
|
36 |
+
confidence_scores = class_probabilities[0]
|
37 |
|
38 |
return {
|
39 |
"Pneumonia": pneumonia_prediction,
|
|
|
59 |
["NORMAL2-IM-1431-0001.jpeg"]
|
60 |
],
|
61 |
theme="default",
|
62 |
+
allow_flagging=False
|
63 |
)
|
64 |
|
|
|
65 |
gradio_interface.launch()
|