feat: Choose dataset with options
This commit is contained in:
parent
20bdd4f566
commit
81c767371e
5 changed files with 67 additions and 60 deletions
|
|
@ -10,11 +10,14 @@ Author: Tibo De Peuter
|
|||
class Dataset(TorchDataset, ABC):
|
||||
"""Abstract base class for datasets."""
|
||||
@abstractmethod
|
||||
def __init__(self, root: str, transform: Callable = None):
|
||||
def __init__(self, name: str, root: str | None, transform: Callable = None):
|
||||
"""
|
||||
:param root: Relative path to the dataset root directory
|
||||
"""
|
||||
self._root: str = join(curdir, 'data', root)
|
||||
if root is None:
|
||||
root = join(curdir, 'data')
|
||||
|
||||
self._root = join(root, name)
|
||||
self.transform = transform
|
||||
self.dataset = None
|
||||
|
||||
|
|
|
|||
Reference in a new issue