Skip to content

Commit 03ad7d8

Browse files
author
The TensorFlow Datasets Authors
committed
Bugfix - add manual test path to TAO dataset.
PiperOrigin-RevId: 693665598
1 parent ed6a581 commit 03ad7d8

File tree

1 file changed

+6
-4
lines changed
  • tensorflow_datasets/video/tao

1 file changed

+6
-4
lines changed

tensorflow_datasets/video/tao/tao.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _merge_categories_map(annotations: NestedDict) -> dict[str, str]:
9494

9595
def _maybe_prepare_manual_data(
9696
dl_manager: tfds.download.DownloadManager,
97-
) -> tuple[epath.Path | None, epath.Path | None]:
97+
) -> tuple[epath.Path | None, epath.Path | None, epath.Path | None]:
9898
"""Return paths to the manually downloaded data if it is available."""
9999

100100
# The file has a different name each time it is downloaded.
@@ -107,7 +107,7 @@ def _maybe_prepare_manual_data(
107107
for file in manually_downloaded_files:
108108
file_glob = [_ for _ in dl_manager.manual_dir.glob(file)]
109109
if not file_glob: # No manually downloaded files.
110-
return None, None
110+
return None, None, None
111111
if len(file_glob) == 1:
112112
files.append(file_glob[0])
113113
else:
@@ -341,7 +341,9 @@ def _split_generators(self, dl_manager: tfds.download.DownloadManager):
341341
'annotations': _ANNOTATIONS_URL,
342342
})
343343

344-
manual_train, manual_val = _maybe_prepare_manual_data(dl_manager)
344+
manual_train, manual_val, manual_test = _maybe_prepare_manual_data(
345+
dl_manager
346+
)
345347
id_map = _get_category_id_map(data['annotations'] / 'annotations-1.2')
346348

347349
return {
@@ -363,7 +365,7 @@ def _split_generators(self, dl_manager: tfds.download.DownloadManager):
363365
),
364366
tfds.Split.TEST: self._generate_examples(
365367
data_path=data['test'],
366-
manual_path=None,
368+
manual_path=manual_test,
367369
annotations_path=data['annotations']
368370
/ 'annotations-1.2'
369371
/ 'test_without_annotations.json',

0 commit comments

Comments
 (0)