Datasets:
train/test/val
How do i implement split functionality on a dataloader from this dataset
Hi Prateek,
All of the datasets in https://huggingface.co/datasets/torchgeo/ are intended for use with the TorchGeo library. You can use it like so:
from torchgeo.datasets import EuroSAT
train_dataset = EuroSAT('data', split='train', download=True)
val_dataset = EuroSAT('data', split='val', download=True)
test_dataset = EuroSAT('data', split='test', download=True)
See https://torchgeo.readthedocs.io/en/latest/api/datasets.html#eurosat for documentation.
Hello
@ajstewart
thank you for your response i have updated my dataloader but encountering a problem with this URL
https://datasets-server.huggingface.co/rows?dataset=torchgeo%2Feurosat&config=default&split=val&offset=0&length=100
Train and test URLS are working. Can you pls look into the issue
I don't know what this URL means, where you got it, or what it's supposed to do. It's possible this dataset does not conform to some standard expected by Hugging Face. This dataset was only ever intended for use with TorchGeo.
I got it from here https://huggingface.co/datasets/torchgeo/eurosat?viewer_api=true
actually i am trying to download the dataset in splits using these links in the dataloader in R.
download = function() {
if (file.exists(self$data_file)) {
message("Dataset already exists. Skipping download.")
return(invisible(NULL))
}
dir.create(self$root, recursive = TRUE, showWarnings = FALSE)
split_url <- sprintf(
"https://datasets-server.huggingface.co/rows?dataset=torchgeo%%2Feurosat&config=default&split=%s&offset=0&length=100",
self$split
)
utils::download.file(
split_url,
destfile = self$data_file,
mode = "wb"
)
}
Oh interesting. I'm not sure why "val" doesn't work, but it looks like "validation" does: https://datasets-server.huggingface.co/rows?dataset=torchgeo%2Feurosat&config=default&split=validation&offset=0&length=100
Refer to the API docs for more possible variants: https://huggingface.co/collections/datasets-examples/file-names-and-splits-655e28af4471bd95709eb135