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
7cc688ae
Unverified
Commit
7cc688ae
authored
Nov 19, 2018
by
Yukun Zhu
Committed by
GitHub
Nov 19, 2018
Browse files
Merge pull request #5781 from linuxpolska/master
Improved performance of deeplab inference
parents
a6494752
0958967d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
research/deeplab/export_model.py
research/deeplab/export_model.py
+3
-2
No files found.
research/deeplab/export_model.py
View file @
7cc688ae
...
...
@@ -126,9 +126,10 @@ def main(unused_argv):
eval_scales
=
FLAGS
.
inference_scales
,
add_flipped_images
=
FLAGS
.
add_flipped_images
)
predictions
=
tf
.
cast
(
predictions
[
common
.
OUTPUT_TYPE
],
tf
.
float32
)
# Crop the valid regions from the predictions.
semantic_predictions
=
tf
.
slice
(
predictions
[
common
.
OUTPUT_TYPE
]
,
predictions
,
[
0
,
0
,
0
],
[
1
,
resized_image_size
[
0
],
resized_image_size
[
1
]])
# Resize back the prediction to the original image size.
...
...
@@ -140,7 +141,7 @@ def main(unused_argv):
label_size
,
method
=
tf
.
image
.
ResizeMethod
.
NEAREST_NEIGHBOR
,
align_corners
=
True
)
return
tf
.
squeeze
(
resized_label
,
3
)
return
tf
.
cast
(
tf
.
squeeze
(
resized_label
,
3
)
,
tf
.
int32
)
semantic_predictions
=
_resize_label
(
semantic_predictions
,
image_size
)
semantic_predictions
=
tf
.
identity
(
semantic_predictions
,
name
=
_OUTPUT_NAME
)
...
...
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