Skip to content

Commit

Permalink
built dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jprokos26 committed Dec 26, 2022
1 parent 1bcd0ee commit 956405a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
3 changes: 3 additions & 0 deletions armory/datasets/adversarial/carla_mot_dev/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""carla_mot_dev dataset."""

from .carla_mot_dev import CarlaMotDev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import glob
import re
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow as tf
import tensorflow_datasets as tfds


Expand All @@ -22,7 +22,7 @@
}
"""

_URLS = "https://armory-public-data.s3.us-east-2.amazonaws.com/carla/carla_mot_dev_1.0.0.tar.gz"
_URL = "https://armory-public-data.s3.us-east-2.amazonaws.com/carla/carla_mot_dev_1.0.0.tar.gz"


class CarlaMOTDev(tfds.core.GeneratorBasedBuilder):
Expand Down Expand Up @@ -70,14 +70,9 @@ def _info(self) -> tfds.core.DatasetInfo:

def _split_generators(self, dl_manager: tfds.download.DownloadManager):
"""Returns SplitGenerators."""
path = dl_manager.download_and_extract(_URLS)
path = dl_manager.download_and_extract(_URL)

return [
tfds.core.SplitGenerator(
name="dev",
gen_kwargs={"path": os.path.join(path, "dev")},
)
]
return {"dev": self._generate_examples(path / "dev")}

def _generate_examples(self, path):
"""Yields examples."""
Expand Down
25 changes: 25 additions & 0 deletions armory/datasets/adversarial/carla_mot_dev/carla_mot_dev_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""carla_mot_dev dataset."""

import tensorflow_datasets as tfds
from . import carla_mot_dev


class CarlaMotDevTest(tfds.testing.DatasetBuilderTestCase):
"""Tests for carla_mot_dev dataset."""

# TODO(carla_mot_dev):
DATASET_CLASS = carla_mot_dev.CarlaMotDev
SPLITS = {
"train": 3, # Number of fake train example
"test": 1, # Number of fake test example
}

# If you are calling `download/download_and_extract` with a dict, like:
# dl_manager.download({'some_key': 'http://a.org/out.txt', ...})
# then the tests needs to provide the fake output paths relative to the
# fake data directory
# DL_EXTRACT_RESULT = {'some_key': 'output_file1.txt', ...}


if __name__ == "__main__":
tfds.testing.test_main()
1 change: 1 addition & 0 deletions armory/datasets/adversarial/carla_mot_dev/checksums.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://armory-public-data.s3.us-east-2.amazonaws.com/carla/carla_mot_dev_1.0.0.tar.gz 704303119 cdd4be9cd3bcb5c2f94a6628350f106deec6fdc7b6a9c05711309b2bcc814f3d carla_mot_dev_1.0.0.tar.gz

0 comments on commit 956405a

Please sign in to comment.