remove example model and add arg for disabling wandb
This commit is contained in:
1 parent
6de644d4f0
commit
54c7c3f53a
12 files changed
+63
-189
No files matched your search
@@ -5,7 +5,16 @@ import pytorch_lightning as pl
|
||||
|
||||
|
||||
class DataModule(pl.LightningDataModule):
|
||||
"""The proper datamodule for mnist digits dataset."""
|
||||
"""
|
||||
This is example of datamodule for MNIST digits dataset.
|
||||
All data modules should be located in separate folders with file named 'datamodule.py' containing class which
|
||||
is always called 'DataModule'!
|
||||
|
||||
The folder name of datamodule used during training should be specified in run config and all parameters from
|
||||
'dataset' section will be passed in 'hparams' dictionary.
|
||||
|
||||
All datamodules should have a structure like this one!
|
||||
"""
|
||||
def __init__(self, hparams):
|
||||
super().__init__()
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
from torch.utils.data import Dataset
|
||||
from PIL import Image
|
||||
import os
|
||||
|
||||
|
||||
class TestDataset(Dataset):
|
||||
"""
|
||||
Example dataset class for loading images from folder.
|
||||
'Dataset' classes can be used by 'DataModule' classes.
|
||||
"""
|
||||
|
||||
def __init__(self, img_dir, transform):
|
||||
self.transform = transform
|
||||
self.images = [os.path.join(img_dir, fname) for fname in os.listdir(img_dir)]
|
||||
|
||||
def __getitem__(self, idx):
|
||||
image = Image.open(self.images[idx]).convert("RGB")
|
||||
|
||||
if self.transform is not None:
|
||||
image = self.transform(image)
|
||||
|
||||
return image
|
||||
|
||||
def __len__(self):
|
||||
return len(self.images)
|
||||
Reference in new issue
Block a user