Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ def classify_image(image):
|
|
27 |
predicted_class_idx_pneumonia = logits_pneumonia.argmax(-1).item()
|
28 |
predicted_class_idx_tuberculosis = logits_tuberculosis.argmax(-1).item()
|
29 |
# Define a manual mapping of label indices to human-readable labels
|
30 |
-
index_to_label_pneumonia = {0: "
|
31 |
-
index_to_label_tuberculosis = {0: "
|
32 |
# Convert the index to the model's class label
|
33 |
label_pneumonia = index_to_label_pneumonia.get(predicted_class_idx_pneumonia, "Unknown Label")
|
34 |
label_tuberculosis = index_to_label_tuberculosis.get(predicted_class_idx_tuberculosis, "Unknown Label")
|
|
|
27 |
predicted_class_idx_pneumonia = logits_pneumonia.argmax(-1).item()
|
28 |
predicted_class_idx_tuberculosis = logits_tuberculosis.argmax(-1).item()
|
29 |
# Define a manual mapping of label indices to human-readable labels
|
30 |
+
index_to_label_pneumonia = {0: "Pneumonia = NO",1: "Pneumonia = YES"}
|
31 |
+
index_to_label_tuberculosis = {0: "Tuberculosis = NO",1: "Tuberculosis = YES"}
|
32 |
# Convert the index to the model's class label
|
33 |
label_pneumonia = index_to_label_pneumonia.get(predicted_class_idx_pneumonia, "Unknown Label")
|
34 |
label_tuberculosis = index_to_label_tuberculosis.get(predicted_class_idx_tuberculosis, "Unknown Label")
|