Skip to content

Commit 17ee867

Browse files
author
Ole Kroeger
committed
fixed some bugs threshold and gray image
1 parent 93f5c32 commit 17ee867

11 files changed

+11
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea/
2+
.MNIST_data/

MNIST_data/t10k-images-idx3-ubyte.gz

1.57 MB
Binary file not shown.

MNIST_data/t10k-labels-idx1-ubyte.gz

4.44 KB
Binary file not shown.

MNIST_data/train-images-idx3-ubyte.gz

9.45 MB
Binary file not shown.

MNIST_data/train-labels-idx1-ubyte.gz

28.2 KB
Binary file not shown.

cps/checkpoint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
model_checkpoint_path: "cps/model.ckpt"
2-
all_model_checkpoint_paths: "cps/model.ckpt"
1+
model_checkpoint_path: "model.ckpt"
2+
all_model_checkpoint_paths: "model.ckpt"

cps/model.ckpt

4 Bytes
Binary file not shown.

cps/model.ckpt.meta

10.9 KB
Binary file not shown.

mnist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ def shift(img,sx,sy):
7373
sess.run(init)
7474

7575
# use 1000 batches with a size of 100 each to train our net
76-
for i in range(1000):
76+
for i in range(1):
7777
batch_xs, batch_ys = mnist.train.next_batch(100)
78+
print(batch_xs)
7879
# run the train_step function with the given image values (x) and the real output (y_)
7980
sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
8081

@@ -100,7 +101,7 @@ def shift(img,sx,sy):
100101
i = 0
101102
for no in [8,0,4,3]:
102103
# read the image
103-
gray = cv2.imread("blog/own_"+str(no)+".png", cv2.CV_LOAD_IMAGE_GRAYSCALE)
104+
gray = cv2.imread("blog/own_"+str(no)+".png", 0)
104105

105106
# rescale it
106107
gray = cv2.resize(255-gray, (28, 28))
@@ -174,4 +175,3 @@ def shift(img,sx,sy):
174175
"""
175176
print sess.run(prediction, feed_dict={x: images, y_: correct_vals})
176177
print sess.run(accuracy, feed_dict={x: images, y_: correct_vals})
177-

pro-img/test_2_digitized_image.png

308 Bytes
Loading

0 commit comments

Comments
 (0)