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
bf65145d
Commit
bf65145d
authored
Dec 14, 2017
by
Derek Chow
Browse files
Fix a bug in create_pet_tf_record.py related to mask creation.
parent
0ae575f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
research/object_detection/dataset_tools/create_pet_tf_record.py
...ch/object_detection/dataset_tools/create_pet_tf_record.py
+3
-2
No files found.
research/object_detection/dataset_tools/create_pet_tf_record.py
View file @
bf65145d
...
@@ -160,8 +160,6 @@ def dict_to_tf_example(data,
...
@@ -160,8 +160,6 @@ def dict_to_tf_example(data,
if
not
faces_only
:
if
not
faces_only
:
mask_remapped
=
mask_np
!=
2
mask_remapped
=
mask_np
!=
2
masks
.
append
(
mask_remapped
)
masks
.
append
(
mask_remapped
)
mask_stack
=
np
.
stack
(
masks
).
astype
(
np
.
float32
)
masks_flattened
=
np
.
reshape
(
mask_stack
,
[
-
1
])
feature_dict
=
{
feature_dict
=
{
'image/height'
:
dataset_util
.
int64_feature
(
height
),
'image/height'
:
dataset_util
.
int64_feature
(
height
),
...
@@ -184,8 +182,11 @@ def dict_to_tf_example(data,
...
@@ -184,8 +182,11 @@ def dict_to_tf_example(data,
'image/object/view'
:
dataset_util
.
bytes_list_feature
(
poses
),
'image/object/view'
:
dataset_util
.
bytes_list_feature
(
poses
),
}
}
if
not
faces_only
:
if
not
faces_only
:
mask_stack
=
np
.
stack
(
masks
).
astype
(
np
.
float32
)
masks_flattened
=
np
.
reshape
(
mask_stack
,
[
-
1
])
feature_dict
[
'image/object/mask'
]
=
(
feature_dict
[
'image/object/mask'
]
=
(
dataset_util
.
float_list_feature
(
masks_flattened
.
tolist
()))
dataset_util
.
float_list_feature
(
masks_flattened
.
tolist
()))
example
=
tf
.
train
.
Example
(
features
=
tf
.
train
.
Features
(
feature
=
feature_dict
))
example
=
tf
.
train
.
Example
(
features
=
tf
.
train
.
Features
(
feature
=
feature_dict
))
return
example
return
example
...
...
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