AI-RESEARCHER-2024 commited on
Commit
c4e208d
·
verified ·
1 Parent(s): 7209b2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- mnist_examples = [[x_test[i]] for i in range(10)] # Select first 10 examples and format as nested list
 
 
 
 
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