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
c636ea33
Commit
c636ea33
authored
Sep 08, 2021
by
A. Unique TensorFlower
Browse files
Don't require image/source_id feature if regenerate_source_id is set.
PiperOrigin-RevId: 395539392
parent
dc6c341d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
official/vision/beta/dataloaders/tf_example_decoder.py
official/vision/beta/dataloaders/tf_example_decoder.py
+4
-1
No files found.
official/vision/beta/dataloaders/tf_example_decoder.py
View file @
c636ea33
...
@@ -38,7 +38,6 @@ class TfExampleDecoder(decoder.Decoder):
...
@@ -38,7 +38,6 @@ class TfExampleDecoder(decoder.Decoder):
self
.
_regenerate_source_id
=
regenerate_source_id
self
.
_regenerate_source_id
=
regenerate_source_id
self
.
_keys_to_features
=
{
self
.
_keys_to_features
=
{
'image/encoded'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
string
),
'image/encoded'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
string
),
'image/source_id'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
string
),
'image/height'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
int64
),
'image/height'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
int64
),
'image/width'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
int64
),
'image/width'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
int64
),
'image/object/bbox/xmin'
:
tf
.
io
.
VarLenFeature
(
tf
.
float32
),
'image/object/bbox/xmin'
:
tf
.
io
.
VarLenFeature
(
tf
.
float32
),
...
@@ -54,6 +53,10 @@ class TfExampleDecoder(decoder.Decoder):
...
@@ -54,6 +53,10 @@ class TfExampleDecoder(decoder.Decoder):
self
.
_keys_to_features
.
update
({
self
.
_keys_to_features
.
update
({
'image/object/mask'
:
tf
.
io
.
VarLenFeature
(
tf
.
string
),
'image/object/mask'
:
tf
.
io
.
VarLenFeature
(
tf
.
string
),
})
})
if
not
regenerate_source_id
:
self
.
_keys_to_features
.
update
({
'image/source_id'
:
tf
.
io
.
FixedLenFeature
((),
tf
.
string
),
})
def
_decode_image
(
self
,
parsed_tensors
):
def
_decode_image
(
self
,
parsed_tensors
):
"""Decodes the image and set its static shape."""
"""Decodes the image and set its static shape."""
...
...
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