Commit 1f579e0e authored by Kaushik Shivakumar's avatar Kaushik Shivakumar
Browse files

fix suggestions in utils

parent 98d9f3b8
......@@ -200,6 +200,8 @@ def make_sequence_example(dataset_name,
detection_scores: (Optional) A list (with num_frames_elements) of
[num_boxes_i] numpy float32 arrays holding predicted object scores for
each frame.
use_strs_for_source_id: (Optional) Whether to write the source IDs as strings
rather than byte lists of characters.
Returns:
A tf.train.SequenceExample.
......
......@@ -104,12 +104,12 @@ class SeqExampleUtilTest(tf.test.TestCase):
source_ids)
def test_make_labeled_example(self):
num_frames = 2
num_frames = 3
image_height = 100
image_width = 200
dataset_name = b'unlabeled_dataset'
video_id = b'video_000'
labels = [b'dog', b'cat']
labels = [b'dog', b'cat', b'wolf']
images = tf.cast(tf.random.uniform(
[num_frames, image_height, image_width, 3],
maxval=256,
......@@ -117,8 +117,8 @@ class SeqExampleUtilTest(tf.test.TestCase):
images_list = tf.unstack(images, axis=0)
encoded_images_list = [tf.io.encode_jpeg(image) for image in images_list]
encoded_images = self.materialize_tensors(encoded_images_list)
timestamps = [100000, 110000]
is_annotated = [1, 0]
timestamps = [100000, 110000, 120000]
is_annotated = [1, 0, 1]
bboxes = [
np.array([[0., 0., 0., 0.],
[0., 0., 1., 1.]], dtype=np.float32),
......@@ -127,6 +127,7 @@ class SeqExampleUtilTest(tf.test.TestCase):
]
label_strings = [
np.array(labels),
np.array([]),
np.array([])
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment