Buckets:
| import os | |
| import torch | |
| import torchvision.datasets as datasets | |
| class PCAM: | |
| def __init__( | |
| self, | |
| preprocess, | |
| location=os.path.expanduser("~/data"), | |
| batch_size=128, | |
| num_workers=6, | |
| ): | |
| location = os.path.join(location, "PCAM") | |
| self.train_dataset = datasets.PCAM( | |
| root=location, download=False, split="train", transform=preprocess | |
| ) | |
| self.train_loader = torch.utils.data.DataLoader( | |
| self.train_dataset, | |
| batch_size=batch_size, | |
| shuffle=True, | |
| num_workers=num_workers, | |
| ) | |
| self.test_dataset = datasets.PCAM( | |
| root=location, download=False, split="test", transform=preprocess | |
| ) | |
| self.test_loader = torch.utils.data.DataLoader( | |
| self.test_dataset, | |
| batch_size=batch_size, | |
| shuffle=False, | |
| num_workers=num_workers, | |
| ) | |
| self.classnames = [ | |
| "lymph node", | |
| "lymph node containing metastatic tumor tissue", | |
| ] | |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- 9c844df0f2d5d76551ba630dffe9f27ecb6d91e4278d502f304f7097d8f096c1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.