Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
recover
Browse files Browse the repository at this point in the history
  • Loading branch information
fwy423 committed Apr 5, 2017
1 parent 955dc54 commit 18191e7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions my_params/checkpoint
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
model_checkpoint_path: "save_net.ckpt"
all_model_checkpoint_paths: "save_net.ckpt"
model_checkpoint_path: "light-model"
all_model_checkpoint_paths: "light-model"
Binary file added my_params/light-model.data-00000-of-00001
Binary file not shown.
Binary file added my_params/light-model.index
Binary file not shown.
Binary file added my_params/light-model.meta
Binary file not shown.
8 changes: 7 additions & 1 deletion tensorflow_recover_CNN_lighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def upsampling_layer(input_x, k_size):
learning_rate = 1e-4

batch_size = 128
epoch = 50
epoch = 80

####################
# Building Network #
Expand Down Expand Up @@ -305,6 +305,12 @@ def upsampling_layer(input_x, k_size):

sess.run(tf.global_variables_initializer())

# load the previous training result if it is possible
try:
saver.restore(sess, "my_params/light-model")
except Exception:
pass

iter_total = 0
for i in range(epoch):
iters = int(train_input.shape[0] / batch_size)
Expand Down
15 changes: 8 additions & 7 deletions tesser_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ def batch_rec(img_path):

dirs = os.listdir(img_path)
for img in dirs:
# try:
# content = tesserocr.file_to_text(img)
# except Exception:
# print("skip", img)
# continue

content = tesserocr.file_to_text(img_path+img)
print("predicting "+img)
try:
content = tesserocr.file_to_text(img)
except Exception:
print("skip", img)
continue

# content = tesserocr.file_to_text(img_path+img)

name, _ = img.split(".")
with open(img_path + name + '_rec.txt', 'w') as file:
Expand Down

0 comments on commit 18191e7

Please sign in to comment.