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
d08a1c66
Commit
d08a1c66
authored
Aug 04, 2020
by
Kaushik Shivakumar
Browse files
fix exporters
parent
d73569c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
research/object_detection/exporter_lib_v2.py
research/object_detection/exporter_lib_v2.py
+12
-10
No files found.
research/object_detection/exporter_lib_v2.py
View file @
d08a1c66
...
@@ -21,7 +21,7 @@ from object_detection.builders import model_builder
...
@@ -21,7 +21,7 @@ from object_detection.builders import model_builder
from
object_detection.core
import
standard_fields
as
fields
from
object_detection.core
import
standard_fields
as
fields
from
object_detection.data_decoders
import
tf_example_decoder
from
object_detection.data_decoders
import
tf_example_decoder
from
object_detection.utils
import
config_util
from
object_detection.utils
import
config_util
import
ast
def
_decode_image
(
encoded_image_string_tensor
):
def
_decode_image
(
encoded_image_string_tensor
):
image_tensor
=
tf
.
image
.
decode_image
(
encoded_image_string_tensor
,
image_tensor
=
tf
.
image
.
decode_image
(
encoded_image_string_tensor
,
...
@@ -50,12 +50,11 @@ def _zip_side_inputs(side_input_shapes="",
...
@@ -50,12 +50,11 @@ def _zip_side_inputs(side_input_shapes="",
Returns:
Returns:
a zipped list of side input tuples.
a zipped list of side input tuples.
"""
"""
if
(
side_input_shapes
)
side_input_shapes
=
list
(
map
(
lambda
x
:
ast
.
literal_eval
(
'['
+
x
+
']'
),
side_input_shapes
=
list
(
map
(
lambda
x
:
eval
(
'['
+
x
+
']'
),
side_input_shapes
.
split
(
"/"
)))
side_input_shapes
.
split
(
'/'
)))
side_input_types
=
map
(
eval
,
side_input_types
.
split
(
","
))
side_input_types
=
eval
(
'['
+
side_input_types
+
']'
)
print
(
list
(
side_input_types
))
side_input_names
=
side_input_names
.
split
(
','
)
#side_input_types = list(map(eval, side_input_types.split(",")))
return
zip
(
side_input_shapes
,
side_input_types
,
side_input_names
)
return
zip
(
side_input_shapes
,
side_input_types
,
side_input_names
.
split
(
","
))
class
DetectionInferenceModule
(
tf
.
Module
):
class
DetectionInferenceModule
(
tf
.
Module
):
"""Detection Inference Module."""
"""Detection Inference Module."""
...
@@ -220,6 +219,9 @@ def export_inference_graph(input_type,
...
@@ -220,6 +219,9 @@ def export_inference_graph(input_type,
raise
ValueError
(
'Unrecognized `input_type`'
)
raise
ValueError
(
'Unrecognized `input_type`'
)
if
use_side_inputs
and
input_type
!=
'image_tensor'
:
if
use_side_inputs
and
input_type
!=
'image_tensor'
:
raise
ValueError
(
'Side inputs supported for image_tensor input type only.'
)
raise
ValueError
(
'Side inputs supported for image_tensor input type only.'
)
zipped_side_inputs
=
None
if
use_side_inputs
:
zipped_side_inputs
=
_zip_side_inputs
(
side_input_shapes
,
zipped_side_inputs
=
_zip_side_inputs
(
side_input_shapes
,
side_input_types
,
side_input_types
,
side_input_names
)
side_input_names
)
...
...
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