Skip to content

Instantly share code, notes, and snippets.

@adamjstewart
Created May 5, 2022 22:06
Show Gist options
  • Save adamjstewart/09764f57dea14996aeb39dd57bc55d83 to your computer and use it in GitHub Desktop.
Save adamjstewart/09764f57dea14996aeb39dd57bc55d83 to your computer and use it in GitHub Desktop.
Using a benchmark dataset with TorchGeo
from torch.utils.data import DataLoader
from torchgeo.datasets import VHR10
dataset = VHR10(root="...", download=True, checksum=True)
dataloader = DataLoader(dataset, batch_size=128, shuffle=True, num_workers=4)
for batch in dataloader:
image = batch["image"]
label = batch["label"]
# train a model, or make predictions using a pre-trained model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment