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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -17,8 +17,6 @@ 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.Label(label = "Predicted Probability per class" num_top_classes=4)
21
-
22
  def image_classification(input1, input2):
23
  image = input1.reshape(1, 28 *28)
24
  X_train = x_train.reshape(60000, 28*28)
@@ -30,11 +28,10 @@ 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 # 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
37
  gr.Interface(fn=image_classification,
38
  inputs=[input_module1, input_module2],
39
- outputs=[output_module1, output_module2]
40
  ).launch(debug = True)
 
17
 
18
  output_module1 = gr.outputs.Textbox(label = "Predicted Digit")
19
 
 
 
20
  def image_classification(input1, input2):
21
  image = input1.reshape(1, 28 *28)
22
  X_train = x_train.reshape(60000, 28*28)
 
28
  y_test_predicted_label = kNN_classifier.predict(image)
29
 
30
  output1 = y_test_predicted_label[0]# text output example
31
+
32
+ return output1
 
33
  # Step 6.4: Put all three component together into the gradio's interface function
34
  gr.Interface(fn=image_classification,
35
  inputs=[input_module1, input_module2],
36
+ outputs=[output_module1]
37
  ).launch(debug = True)