Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#Part 1
|
2 |
+
%matplotlib inline
|
3 |
+
import matplotlib as mpl
|
4 |
+
import matplotlib.pyplot as plt
|
5 |
+
import pandas as pd
|
6 |
+
import numpy as np
|
7 |
+
import time
|
8 |
+
import tensorflow as tf
|
9 |
+
from sklearn.metrics import accuracy_score
|
10 |
+
from sklearn.neighbors import KNeighborsClassifier
|
11 |
+
|
12 |
+
#step 1
|
13 |
+
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
|
14 |
+
|
15 |
+
input_module1 = gr.inputs.Image(label = "test_image")
|
16 |
+
|
17 |
+
input_module2 = gr.inputs.Slider(1, 10, step=1, label = "k")
|
18 |
+
|
19 |
+
output_module1 = gr.outputs.Textbox(label = "Predicted Digit")
|
20 |
+
|
21 |
+
output_module2 = gr.outputs.Image(label = "Predicted Probability by class")
|