"src/vscode:/vscode.git/clone" did not exist on "e682af202787c44da4c7e583b95ec7f42dc45029"
Unverified Commit 7bb8186c authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix eurosat prototype mock data setup (#5549)

* [DEBUG] eurosat prototype on windows and macos

* print paths

* fix eurosat mock data setup

* revert changes

* minor cleanup
parent 27745e5b
......@@ -1329,20 +1329,20 @@ def cub200(info, root, config):
@register_mock
def eurosat(info, root, config):
data_folder = pathlib.Path(root, "eurosat", "2750")
data_folder = root / "2750"
data_folder.mkdir(parents=True)
num_examples_per_class = 3
classes = ("AnnualCrop", "Forest")
for cls in classes:
categories = ["AnnualCrop", "Forest"]
for category in categories:
create_image_folder(
root=data_folder,
name=cls,
file_name_fn=lambda idx: f"{cls}_{idx}.jpg",
name=category,
file_name_fn=lambda idx: f"{category}_{idx + 1}.jpg",
num_examples=num_examples_per_class,
)
make_zip(root, "EuroSAT.zip", data_folder)
return len(classes) * num_examples_per_class
return len(categories) * num_examples_per_class
@register_mock
......
......@@ -53,6 +53,8 @@ class TestCommon:
try:
sample = next(iter(dataset))
except StopIteration:
raise AssertionError("Unable to draw any sample.") from None
except Exception as error:
raise AssertionError("Drawing a sample raised the error above.") from error
......
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