"research/compression/image_encoder/encoder.py" did not exist on "9dd85db269d10d0f085091c7b854cdcb8d1d5809"
Commit 0f904081 authored by Rohan Jain's avatar Rohan Jain Committed by GitHub
Browse files

Merge pull request #543 from jart/rollback-open

Revert "Use open() instead of tf.gfile.FastGFile()"
parents 43dad800 e93fdcca
...@@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab): ...@@ -210,7 +210,7 @@ def _to_sequence_example(image, decoder, vocab):
Returns: Returns:
A SequenceExample proto. A SequenceExample proto.
""" """
with open(image.filename, "r") as f: with tf.gfile.FastGFile(image.filename, "r") as f:
encoded_image = f.read() encoded_image = f.read()
try: try:
......
...@@ -199,7 +199,7 @@ def _process_image(filename, coder): ...@@ -199,7 +199,7 @@ def _process_image(filename, coder):
width: integer, image width in pixels. width: integer, image width in pixels.
""" """
# Read the image file. # Read the image file.
with open(filename, 'r') as f: with tf.gfile.FastGFile(filename, 'r') as f:
image_data = f.read() image_data = f.read()
# Convert any PNG to JPEG's for consistency. # Convert any PNG to JPEG's for consistency.
......
...@@ -313,7 +313,7 @@ def _process_image(filename, coder): ...@@ -313,7 +313,7 @@ def _process_image(filename, coder):
width: integer, image width in pixels. width: integer, image width in pixels.
""" """
# Read the image file. # Read the image file.
with open(filename, 'r') as f: with tf.gfile.FastGFile(filename, 'r') as f:
image_data = f.read() image_data = f.read()
# Clean the dirty data. # Clean the dirty data.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment