MCPcopy Index your code
hub / github.com/geekcomputers/Python / Caltech256Dataset

Class Caltech256Dataset

ML/src/python/neuralforge/data/datasets.py:238–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236 return self.dataset[idx]
237
238class Caltech256Dataset:
239 def __init__(self, root='./data', transform=None, download=True):
240 if transform is None:
241 transform = transforms.Compose([
242 transforms.Resize(256),
243 transforms.CenterCrop(224),
244 transforms.ToTensor(),
245 transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
246 ])
247
248 self.dataset = datasets.Caltech256(root=root, transform=transform, download=download)
249
250 def __len__(self):
251 return len(self.dataset)
252
253 def __getitem__(self, idx):
254 return self.dataset[idx]
255
256class OxfordPetsDataset:
257 def __init__(self, root='./data', split='trainval', transform=None, download=True):

Callers 1

get_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected