runaksh commited on
Commit
0b02349
·
verified ·
1 Parent(s): fbb55a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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: "NORMAL",1: "PNEUMONIA"}
31
- index_to_label_tuberculosis = {0: "NORMAL",1: "TUBERCULOSIS"}
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")