Halima commited on
Commit
9d36a2a
1 Parent(s): 938072c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ input_module2 = gr.inputs.Slider(1, 10, step=1, label = "k")
17
 
18
  output_module1 = gr.outputs.Textbox(label = "Predicted Digit")
19
 
20
- output_module2 = gr.outputs.Image(label = "Predicted Probability per class")
21
 
22
  def image_classification(input1, input2):
23
  image = input1.reshape(1, 28 *28)
@@ -30,7 +30,7 @@ def image_classification(input1, input2):
30
  y_test_predicted_label = kNN_classifier.predict(image)
31
 
32
  output1 = y_test_predicted_label[0]# text output example
33
- output2 = y_test_predicted_label[1] # image-like array output example
34
  return output1,output2
35
 
36
  # Step 6.4: Put all three component together into the gradio's interface function
 
17
 
18
  output_module1 = gr.outputs.Textbox(label = "Predicted Digit")
19
 
20
+ output_module2 = gr.outputs.Label(label = "Predicted Probability per class" num_top_classes=4)
21
 
22
  def image_classification(input1, input2):
23
  image = input1.reshape(1, 28 *28)
 
30
  y_test_predicted_label = kNN_classifier.predict(image)
31
 
32
  output1 = y_test_predicted_label[0]# text output example
33
+ output2 = y_test_predicted_label # image-like array output example
34
  return output1,output2
35
 
36
  # Step 6.4: Put all three component together into the gradio's interface function