Update app.py
Browse files
app.py
CHANGED
|
@@ -10,16 +10,16 @@ def predict(image):
|
|
| 10 |
results = {}
|
| 11 |
for p in predictions:
|
| 12 |
if p["label"] == "MoHat":
|
| 13 |
-
results["Granulation tissue
|
| 14 |
elif p["label"] == "MoGiaMacNhiemKhuan":
|
| 15 |
-
results["Pseudomembranous tissue with a bacterial infection
|
| 16 |
elif p["label"] == "MoHoaiTu":
|
| 17 |
-
results["Necrotic tissue
|
| 18 |
return results
|
| 19 |
|
| 20 |
gr.Interface(
|
| 21 |
predict,
|
| 22 |
-
inputs=gr.inputs.Image(label="Upload
|
| 23 |
outputs=gr.outputs.Label(num_top_classes=5),
|
| 24 |
-
title="Diabetic Ulcer Image Classification
|
| 25 |
).launch()
|
|
|
|
| 10 |
results = {}
|
| 11 |
for p in predictions:
|
| 12 |
if p["label"] == "MoHat":
|
| 13 |
+
results["Granulation tissue"] = p["score"]
|
| 14 |
elif p["label"] == "MoGiaMacNhiemKhuan":
|
| 15 |
+
results["Pseudomembranous tissue with a bacterial infection"] = p["score"]
|
| 16 |
elif p["label"] == "MoHoaiTu":
|
| 17 |
+
results["Necrotic tissue"] = p["score"]
|
| 18 |
return results
|
| 19 |
|
| 20 |
gr.Interface(
|
| 21 |
predict,
|
| 22 |
+
inputs=gr.inputs.Image(label="Upload a diabetic foot ulcer image", type="filepath"),
|
| 23 |
outputs=gr.outputs.Label(num_top_classes=5),
|
| 24 |
+
title="Diabetic Foot Ulcer Image Classification",
|
| 25 |
).launch()
|