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
1f579e0e
"gallery/assets/vscode:/vscode.git/clone" did not exist on "c786d7550a8ee840d1ea7a0fcb44feba5c39e3ef"
Commit
1f579e0e
authored
Aug 26, 2020
by
Kaushik Shivakumar
Browse files
fix suggestions in utils
parent
98d9f3b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
research/object_detection/dataset_tools/seq_example_util.py
research/object_detection/dataset_tools/seq_example_util.py
+2
-0
research/object_detection/dataset_tools/seq_example_util_test.py
...h/object_detection/dataset_tools/seq_example_util_test.py
+5
-4
No files found.
research/object_detection/dataset_tools/seq_example_util.py
View file @
1f579e0e
...
@@ -200,6 +200,8 @@ def make_sequence_example(dataset_name,
...
@@ -200,6 +200,8 @@ def make_sequence_example(dataset_name,
detection_scores: (Optional) A list (with num_frames_elements) of
detection_scores: (Optional) A list (with num_frames_elements) of
[num_boxes_i] numpy float32 arrays holding predicted object scores for
[num_boxes_i] numpy float32 arrays holding predicted object scores for
each frame.
each frame.
use_strs_for_source_id: (Optional) Whether to write the source IDs as strings
rather than byte lists of characters.
Returns:
Returns:
A tf.train.SequenceExample.
A tf.train.SequenceExample.
...
...
research/object_detection/dataset_tools/seq_example_util_test.py
View file @
1f579e0e
...
@@ -104,12 +104,12 @@ class SeqExampleUtilTest(tf.test.TestCase):
...
@@ -104,12 +104,12 @@ class SeqExampleUtilTest(tf.test.TestCase):
source_ids
)
source_ids
)
def
test_make_labeled_example
(
self
):
def
test_make_labeled_example
(
self
):
num_frames
=
2
num_frames
=
3
image_height
=
100
image_height
=
100
image_width
=
200
image_width
=
200
dataset_name
=
b
'unlabeled_dataset'
dataset_name
=
b
'unlabeled_dataset'
video_id
=
b
'video_000'
video_id
=
b
'video_000'
labels
=
[
b
'dog'
,
b
'cat'
]
labels
=
[
b
'dog'
,
b
'cat'
,
b
'wolf'
]
images
=
tf
.
cast
(
tf
.
random
.
uniform
(
images
=
tf
.
cast
(
tf
.
random
.
uniform
(
[
num_frames
,
image_height
,
image_width
,
3
],
[
num_frames
,
image_height
,
image_width
,
3
],
maxval
=
256
,
maxval
=
256
,
...
@@ -117,8 +117,8 @@ class SeqExampleUtilTest(tf.test.TestCase):
...
@@ -117,8 +117,8 @@ class SeqExampleUtilTest(tf.test.TestCase):
images_list
=
tf
.
unstack
(
images
,
axis
=
0
)
images_list
=
tf
.
unstack
(
images
,
axis
=
0
)
encoded_images_list
=
[
tf
.
io
.
encode_jpeg
(
image
)
for
image
in
images_list
]
encoded_images_list
=
[
tf
.
io
.
encode_jpeg
(
image
)
for
image
in
images_list
]
encoded_images
=
self
.
materialize_tensors
(
encoded_images_list
)
encoded_images
=
self
.
materialize_tensors
(
encoded_images_list
)
timestamps
=
[
100000
,
110000
]
timestamps
=
[
100000
,
110000
,
120000
]
is_annotated
=
[
1
,
0
]
is_annotated
=
[
1
,
0
,
1
]
bboxes
=
[
bboxes
=
[
np
.
array
([[
0.
,
0.
,
0.
,
0.
],
np
.
array
([[
0.
,
0.
,
0.
,
0.
],
[
0.
,
0.
,
1.
,
1.
]],
dtype
=
np
.
float32
),
[
0.
,
0.
,
1.
,
1.
]],
dtype
=
np
.
float32
),
...
@@ -127,6 +127,7 @@ class SeqExampleUtilTest(tf.test.TestCase):
...
@@ -127,6 +127,7 @@ class SeqExampleUtilTest(tf.test.TestCase):
]
]
label_strings
=
[
label_strings
=
[
np
.
array
(
labels
),
np
.
array
(
labels
),
np
.
array
([]),
np
.
array
([])
np
.
array
([])
]
]
...
...
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