Skip to content

Conversation

alexgorban
Copy link
Contributor

Before the fix the demo_inference.py used batch_norm and it did the normalization of input image implicitly. If at the inference time the batch_norm was disabled the inference produced incorrect results.

This fix:

  1. does the proper input image normalization and disables the batch_norm at inference time.
  2. introduces demo_inference_test.py to make sure the demo_inference works correctly
  3. numerous auto formatting changes.

Alexander Gorban added 2 commits December 7, 2017 11:04
Before the fix the demo_inference.py used batch_norm and it did the
normalization of input image implicitly. If at inference time the
batch_norm was disabled the inference produced incorrect results.
This fix does the proper input image normalization and disables the batch_norm
at inference time.
@alexgorban
Copy link
Contributor Author

@sguada Can you please review the change?

@sguada sguada self-assigned this Dec 13, 2017
@sguada sguada self-requested a review December 13, 2017 16:11
Copy link
Member

@sguada sguada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix before merging

feed_dict={images_placeholder: images_data})
print("Predicted strings:")
for line in predictions:
for line in run(FLAGS.checkpoint, FLAGS.batch_size, FLAGS.dataset_name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:
predictions = run(FLAGS.checkpoint, FLAGS.batch_size, FLAGS.dataset_name, FLAGS.image_path_pattern)
for line in predictions:
print(line)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

feed_dict={images_placeholder: images_data})
print("Predicted strings:")
for line in predictions:
for line in run(FLAGS.checkpoint, FLAGS.batch_size, FLAGS.dataset_name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed

@alexgorban
Copy link
Contributor Author

This PR was messed up with unsuccessful merges with the upstream. I will create a new one with the required changes to the Attention OCR only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants