Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
dcfe009a
Unverified
Commit
dcfe009a
authored
Apr 03, 2018
by
Nick Johnston
Committed by
GitHub
Apr 03, 2018
Browse files
Merge pull request #3712 from rzumer/fix-compression
Image encoder: fix binary files parsed as UTF-8
parents
a7aa25d3
a305455e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
research/compression/image_encoder/decoder.py
research/compression/image_encoder/decoder.py
+1
-1
research/compression/image_encoder/encoder.py
research/compression/image_encoder/encoder.py
+1
-1
research/compression/image_encoder/msssim.py
research/compression/image_encoder/msssim.py
+2
-2
No files found.
research/compression/image_encoder/decoder.py
View file @
dcfe009a
...
@@ -71,7 +71,7 @@ def main(_):
...
@@ -71,7 +71,7 @@ def main(_):
return
return
contents
=
''
contents
=
''
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
input_codes
,
'r'
)
as
code_file
:
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
input_codes
,
'r
b
'
)
as
code_file
:
contents
=
code_file
.
read
()
contents
=
code_file
.
read
()
loaded_codes
=
np
.
load
(
io
.
BytesIO
(
contents
))
loaded_codes
=
np
.
load
(
io
.
BytesIO
(
contents
))
assert
[
'codes'
,
'shape'
]
not
in
loaded_codes
.
files
assert
[
'codes'
,
'shape'
]
not
in
loaded_codes
.
files
...
...
research/compression/image_encoder/encoder.py
View file @
dcfe009a
...
@@ -59,7 +59,7 @@ def main(_):
...
@@ -59,7 +59,7 @@ def main(_):
print
(
'
\n
--iteration must be between 0 and 15 inclusive.
\n
'
)
print
(
'
\n
--iteration must be between 0 and 15 inclusive.
\n
'
)
return
return
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
input_image
)
as
input_image
:
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
input_image
,
'rb'
)
as
input_image
:
input_image_str
=
input_image
.
read
()
input_image_str
=
input_image
.
read
()
with
tf
.
Graph
().
as_default
()
as
graph
:
with
tf
.
Graph
().
as_default
()
as
graph
:
...
...
research/compression/image_encoder/msssim.py
View file @
dcfe009a
...
@@ -199,9 +199,9 @@ def main(_):
...
@@ -199,9 +199,9 @@ def main(_):
return
return
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
original_image
)
as
image_file
:
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
original_image
)
as
image_file
:
img1_str
=
image_file
.
read
()
img1_str
=
image_file
.
read
(
'rb'
)
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
compared_image
)
as
image_file
:
with
tf
.
gfile
.
FastGFile
(
FLAGS
.
compared_image
)
as
image_file
:
img2_str
=
image_file
.
read
()
img2_str
=
image_file
.
read
(
'rb'
)
input_img
=
tf
.
placeholder
(
tf
.
string
)
input_img
=
tf
.
placeholder
(
tf
.
string
)
decoded_image
=
tf
.
expand_dims
(
tf
.
image
.
decode_png
(
input_img
,
channels
=
3
),
0
)
decoded_image
=
tf
.
expand_dims
(
tf
.
image
.
decode_png
(
input_img
,
channels
=
3
),
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment