Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise warning for Lizard data download #163

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions torch_em/data/datasets/lizard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import warnings
from glob import glob
from shutil import rmtree

Expand All @@ -10,6 +11,10 @@
from tqdm import tqdm
from .import util

# TODO: the links don't work anymore (?)
# workaround to still make this work (kaggle still has the dataset in the same structure):
# - download the zip files manually from here - https://www.kaggle.com/datasets/aadimator/lizard-dataset
# - Kaggle API (TODO) - `kaggle datasets download -d aadimator/lizard-dataset`
URL1 = "https://warwick.ac.uk/fac/cross_fac/tia/data/lizard/lizard_images1.zip"
URL2 = "https://warwick.ac.uk/fac/cross_fac/tia/data/lizard/lizard_images2.zip"
LABEL_URL = "https://warwick.ac.uk/fac/cross_fac/tia/data/lizard/lizard_labels.zip"
Expand Down Expand Up @@ -85,6 +90,9 @@ def get_lizard_dataset(path, patch_shape, download=False, **kwargs):
This dataset is from the publication https://doi.org/10.48550/arXiv.2108.11195.
Please cite it if you use this dataset for a publication.
"""
if download:
warnings.warn(f"The download link does not work right now. Please manually download the zip files to {path} from https://www.kaggle.com/datasets/aadimator/lizard-dataset")

_require_lizard_data(path, download)

data_paths = glob(os.path.join(path, "*.h5"))
Expand Down