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
e3bfb9b8
Unverified
Commit
e3bfb9b8
authored
Apr 09, 2018
by
pkulzc
Committed by
GitHub
Apr 09, 2018
Browse files
Merge pull request #3744 from liangxiao05/master
Update create_pascal_tf_record.py
parents
2506c9a6
e658d645
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
research/object_detection/dataset_tools/create_pascal_tf_record.py
...object_detection/dataset_tools/create_pascal_tf_record.py
+17
-15
No files found.
research/object_detection/dataset_tools/create_pascal_tf_record.py
View file @
e3bfb9b8
...
@@ -104,21 +104,23 @@ def dict_to_tf_example(data,
...
@@ -104,21 +104,23 @@ def dict_to_tf_example(data,
truncated
=
[]
truncated
=
[]
poses
=
[]
poses
=
[]
difficult_obj
=
[]
difficult_obj
=
[]
for
obj
in
data
[
'object'
]:
difficult
=
bool
(
int
(
obj
[
'difficult'
]))
if
data
.
has_key
(
'object'
):
if
ignore_difficult_instances
and
difficult
:
for
obj
in
data
[
'object'
]:
continue
difficult
=
bool
(
int
(
obj
[
'difficult'
]))
if
ignore_difficult_instances
and
difficult
:
difficult_obj
.
append
(
int
(
difficult
))
continue
xmin
.
append
(
float
(
obj
[
'bndbox'
][
'xmin'
])
/
width
)
difficult_obj
.
append
(
int
(
difficult
))
ymin
.
append
(
float
(
obj
[
'bndbox'
][
'ymin'
])
/
height
)
xmax
.
append
(
float
(
obj
[
'bndbox'
][
'xmax'
])
/
width
)
xmin
.
append
(
float
(
obj
[
'bndbox'
][
'xmin'
])
/
width
)
ymax
.
append
(
float
(
obj
[
'bndbox'
][
'ymax'
])
/
height
)
ymin
.
append
(
float
(
obj
[
'bndbox'
][
'ymin'
])
/
height
)
classes_text
.
append
(
obj
[
'name'
].
encode
(
'utf8'
))
xmax
.
append
(
float
(
obj
[
'bndbox'
][
'xmax'
])
/
width
)
classes
.
append
(
label_map_dict
[
obj
[
'name'
]])
ymax
.
append
(
float
(
obj
[
'bndbox'
][
'ymax'
])
/
height
)
truncated
.
append
(
int
(
obj
[
'truncated'
]))
classes_text
.
append
(
obj
[
'name'
].
encode
(
'utf8'
))
poses
.
append
(
obj
[
'pose'
].
encode
(
'utf8'
))
classes
.
append
(
label_map_dict
[
obj
[
'name'
]])
truncated
.
append
(
int
(
obj
[
'truncated'
]))
poses
.
append
(
obj
[
'pose'
].
encode
(
'utf8'
))
example
=
tf
.
train
.
Example
(
features
=
tf
.
train
.
Features
(
feature
=
{
example
=
tf
.
train
.
Example
(
features
=
tf
.
train
.
Features
(
feature
=
{
'image/height'
:
dataset_util
.
int64_feature
(
height
),
'image/height'
:
dataset_util
.
int64_feature
(
height
),
...
...
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