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
5c33ce76
Commit
5c33ce76
authored
Feb 14, 2022
by
A. Unique TensorFlower
Committed by
TF Object Detection Team
Feb 14, 2022
Browse files
Modify seq_example_util.py to explicitly flatten/index ndarrays before assigning to proto fields.
PiperOrigin-RevId: 428574627
parent
5c5ea7ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
research/object_detection/dataset_tools/seq_example_util.py
research/object_detection/dataset_tools/seq_example_util.py
+7
-3
No files found.
research/object_detection/dataset_tools/seq_example_util.py
View file @
5c33ce76
...
...
@@ -32,6 +32,8 @@ def context_float_feature(ndarray):
"""
feature
=
tf
.
train
.
Feature
()
for
val
in
ndarray
:
if
isinstance
(
val
,
np
.
ndarray
):
val
=
val
.
item
()
feature
.
float_list
.
value
.
append
(
val
)
return
feature
...
...
@@ -47,6 +49,8 @@ def context_int64_feature(ndarray):
"""
feature
=
tf
.
train
.
Feature
()
for
val
in
ndarray
:
if
isinstance
(
val
,
np
.
ndarray
):
val
=
val
.
item
()
feature
.
int64_list
.
value
.
append
(
val
)
return
feature
...
...
@@ -81,7 +85,7 @@ def sequence_float_feature(ndarray):
for
row
in
ndarray
:
feature
=
feature_list
.
feature
.
add
()
if
row
.
size
:
feature
.
float_list
.
value
[:]
=
row
feature
.
float_list
.
value
[:]
=
np
.
ravel
(
row
)
return
feature_list
...
...
@@ -98,7 +102,7 @@ def sequence_int64_feature(ndarray):
for
row
in
ndarray
:
feature
=
feature_list
.
feature
.
add
()
if
row
.
size
:
feature
.
int64_list
.
value
[:]
=
row
feature
.
int64_list
.
value
[:]
=
np
.
ravel
(
row
)
return
feature_list
...
...
@@ -118,7 +122,7 @@ def sequence_bytes_feature(ndarray):
feature
=
feature_list
.
feature
.
add
()
if
row
:
row
=
[
tf
.
compat
.
as_bytes
(
val
)
for
val
in
row
]
feature
.
bytes_list
.
value
[:]
=
row
feature
.
bytes_list
.
value
[:]
=
np
.
ravel
(
row
)
return
feature_list
...
...
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