Update app.py
Browse files
app.py
CHANGED
@@ -38,13 +38,7 @@ def predict_pneumonia(image):
|
|
38 |
class_names = ["Pneumonia", "Normal"]
|
39 |
confidence_scores = class_probabilities[0]
|
40 |
|
41 |
-
return
|
42 |
-
"Pneumonia": pneumonia_prediction,
|
43 |
-
"Class probabilities": class_probabilities,
|
44 |
-
"Top classes": top_classes,
|
45 |
-
"Class names": class_names,
|
46 |
-
"Confidence scores": confidence_scores
|
47 |
-
}
|
48 |
|
49 |
inputs = gr.inputs.Image(shape=(180, 180))
|
50 |
outputs = gr.outputs.Label(num_top_classes=2)
|
@@ -55,8 +49,14 @@ gradio_interface = gr.Interface(
|
|
55 |
outputs=outputs,
|
56 |
title="Pneumonia X-Ray Classification API",
|
57 |
description="This API classifies images of chest X-rays as having pneumonia or being normal.",
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
theme="default",
|
59 |
-
allow_flagging=
|
60 |
)
|
61 |
|
62 |
gradio_interface.launch()
|
|
|
38 |
class_names = ["Pneumonia", "Normal"]
|
39 |
confidence_scores = class_probabilities[0]
|
40 |
|
41 |
+
return pneumonia_prediction
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
inputs = gr.inputs.Image(shape=(180, 180))
|
44 |
outputs = gr.outputs.Label(num_top_classes=2)
|
|
|
49 |
outputs=outputs,
|
50 |
title="Pneumonia X-Ray Classification API",
|
51 |
description="This API classifies images of chest X-rays as having pneumonia or being normal.",
|
52 |
+
examples=[
|
53 |
+
["person1000_bacteria_2931.jpeg"],
|
54 |
+
["person1000_virus_1681.jpeg"],
|
55 |
+
["person1946_bacteria_4875.jpeg"],
|
56 |
+
["person1952_bacteria_4883.jpeg"]
|
57 |
+
],
|
58 |
theme="default",
|
59 |
+
allow_flagging="never"
|
60 |
)
|
61 |
|
62 |
gradio_interface.launch()
|