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
f9ff935a
Commit
f9ff935a
authored
Aug 03, 2020
by
Kaushik Shivakumar
Browse files
exporter changes
parent
26ba72bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
research/object_detection/exporter_lib_v2.py
research/object_detection/exporter_lib_v2.py
+17
-17
No files found.
research/object_detection/exporter_lib_v2.py
View file @
f9ff935a
...
...
@@ -39,30 +39,30 @@ def _decode_tf_example(tf_example_string_tensor):
def
_zip_side_inputs
(
side_input_shapes
=
""
,
side_input_types
=
""
,
side_input_names
=
""
):
"""Zips the side inputs together.
"""Zips the side inputs together.
Args:
side_input_shapes: forward-slash-separated list of comma-separated lists
describing input shapes.
side_input_types: comma-separated list of the types of the inputs.
side_input_names: comma-separated list of the names of the inputs.
Args:
side_input_shapes: forward-slash-separated list of comma-separated lists
describing input shapes.
side_input_types: comma-separated list of the types of the inputs.
side_input_names: comma-separated list of the names of the inputs.
Returns:
a zipped list of side input tuples.
"""
side_input_shapes
=
list
(
map
(
lambda
x
:
eval
(
'['
+
x
+
']'
),
side_input_shapes
.
split
(
"/"
)))
side_input_types
=
list
(
map
(
eval
,
side_input_types
.
split
(
","
)))
return
zip
(
side_input_shapes
,
side_input_types
,
side_input_names
.
split
(
","
))
Returns:
a zipped list of side input tuples.
"""
side_input_shapes
=
list
(
map
(
lambda
x
:
eval
(
'['
+
x
+
']'
),
side_input_shapes
.
split
(
"/"
)))
side_input_types
=
list
(
map
(
eval
,
side_input_types
.
split
(
","
)))
return
zip
(
side_input_shapes
,
side_input_types
,
side_input_names
.
split
(
","
))
class
DetectionInferenceModule
(
tf
.
Module
):
"""Detection Inference Module."""
def
__init__
(
self
,
detection_model
,
use_side_inputs
=
False
,
zipped_side_inputs
=
None
:
zipped_side_inputs
=
None
)
:
"""Initializes a module for detection.
Args:
...
...
@@ -116,7 +116,7 @@ class DetectionFromImageModule(DetectionInferenceModule):
name
=
info
[
2
]))
def
__call__
(
input_tensor
,
*
side_inputs
):
kwargs
=
dict
(
zip
(
self
.
side_input_names
.
split
(
","
)
,
side_inputs
))
kwargs
=
dict
(
zip
(
self
.
side_input_names
,
side_inputs
))
return
self
.
_run_inference_on_images
(
input_tensor
,
**
kwargs
)
self
.
__call__
=
tf
.
function
(
__call__
,
input_signature
=
sig
)
...
...
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