runaksh commited on
Commit
8b854a3
·
verified ·
1 Parent(s): f9b41fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -44,8 +44,8 @@ def classify_image_tuberculosis(image):
44
  predicted_class_idx = logits.argmax(-1).item()
45
  # Define a manual mapping of label indices to human-readable labels
46
  index_to_label = {
47
- 0: "NORMAL",
48
- 1: "PNEUMONIA"
49
  }
50
 
51
  # Convert the index to the model's class label
@@ -69,8 +69,8 @@ def make_block(dem):
69
  in_prompt_2 = gr.Image()
70
  out_response_2 = gr.Label()
71
  b2 = gr.Button("Enter")
72
- b1.click(classify_image_pneumonia, inputs=in_prompt_1, outputs=out_response_1)
73
- b2.click(classify_image_tuberculosis, inputs=in_prompt_2, outputs=out_response_2)
74
 
75
  if __name__ == '__main__':
76
 
 
44
  predicted_class_idx = logits.argmax(-1).item()
45
  # Define a manual mapping of label indices to human-readable labels
46
  index_to_label = {
47
+ 0: "PNEUMONIA = NO",
48
+ 1: "PNEUMONIA = YES"
49
  }
50
 
51
  # Convert the index to the model's class label
 
69
  in_prompt_2 = gr.Image()
70
  out_response_2 = gr.Label()
71
  b2 = gr.Button("Enter")
72
+ b1.Block(classify_image_pneumonia, inputs=in_prompt_1, outputs=out_response_1)
73
+ b2.Block(classify_image_tuberculosis, inputs=in_prompt_2, outputs=out_response_2)
74
 
75
  if __name__ == '__main__':
76