Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Nov 5, 2024
1 parent 5cb9b8d commit cb823f8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,26 @@ def generator():
assert "array" in labels
assert labels["label"][0].tolist() == [["dog"], ["cat"]]
assert np.allclose(labels["array"][0], arr)


def test_no_labels():
dataset = LuxonisDataset("__no_labels", delete_existing=True)

def generator():
for i in range(10):
img = make_image(i)
yield {
"file": img,
}

dataset.add(generator())
dataset.make_splits()

loader = LuxonisLoader(dataset)
for _, labels in loader:
assert labels == {}

augments = Augmentations([512, 512], [{"name": "Flip", "params": {}}])
loader = LuxonisLoader(dataset, augmentations=augments)
for _, labels in loader:
assert labels == {}

0 comments on commit cb823f8

Please sign in to comment.