Skip to content

Commit

Permalink
Avoid caching the entire Waymo Open Dataset during loading (#1559)
Browse files Browse the repository at this point in the history
* Avoid caching the entire Waymo Open Dataset during loading

* Formatting
  • Loading branch information
ianstenbit authored Mar 21, 2023
1 parent 4ebbdb9 commit 1974263
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions keras_cv/datasets/waymo/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os

import tensorflow as tf
import tensorflow_datasets as tfds

from keras_cv.datasets.waymo import transformer
from keras_cv.utils import assert_waymo_open_dataset_installed
Expand All @@ -28,9 +27,9 @@

def _generate_frames(segments, transformer):
def _generator():
for record in tfds.as_numpy(segments):
for record in segments:
frame = waymo_open_dataset.dataset_pb2.Frame()
frame.ParseFromString(record)
frame.ParseFromString(record.numpy())
yield transformer(frame)

return _generator
Expand Down

0 comments on commit 1974263

Please sign in to comment.