train/test/val

#2
by Prateek0Xeo - opened

How do i implement split functionality on a dataloader from this dataset

TorchGeo org

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
Screenshot 2025-01-20 210917.png

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"
)

}

Sign up or log in to comment