Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,11 @@ model = load_model('mnist_model.h5')
|
|
14 |
|
15 |
# Load MNIST examples
|
16 |
(x_train, y_train), (x_test, y_test) = mnist.load_data()
|
17 |
-
|
|
|
|
|
|
|
|
|
18 |
# Resize the examples to 100 by 100
|
19 |
mnist_examples = [[cv2.resize(x_test[i], DIMS)] for i in range(10)]
|
20 |
|
|
|
14 |
|
15 |
# Load MNIST examples
|
16 |
(x_train, y_train), (x_test, y_test) = mnist.load_data()
|
17 |
+
# Select one example for each digit 0-9
|
18 |
+
mnist_examples = []
|
19 |
+
for digit in range(10):
|
20 |
+
idx = np.where(y_test == digit)[0][0]
|
21 |
+
mnist_examples.append([x_test[idx]])
|
22 |
# Resize the examples to 100 by 100
|
23 |
mnist_examples = [[cv2.resize(x_test[i], DIMS)] for i in range(10)]
|
24 |
|