datasetops.loaders
Module Contents
Classes
Contains information on how to access the raw data, and performs |
Functions
|
Create dataset from a Pytorch dataset |
|
Create dataset from a Tensorflow dataset |
|
Load data from a folder with the data structure: |
|
Load data from a folder with the data structure: |
Load data from a folder with the data structure: |
|
|
|
Load data from .mat file consisting of multiple data. |
- class datasetops.loaders.Loader(getdata: datasetops.types.Callable[[datasetops.types.Any], datasetops.types.Any], name: str = None)
Bases:
datasetops.dataset.Dataset
Contains information on how to access the raw data, and performs sampling and splitting related operations.
- append(identifier: datasetops.types.Data)
- extend(ids: datasetops.types.Union[datasetops.types.List[datasetops.types.Data], numpy.ndarray])
- datasetops.loaders.from_pytorch(pytorch_dataset)
Create dataset from a Pytorch dataset
- Arguments:
tf_dataset {torch.utils.data.Dataset} – A Pytorch dataset to load from
- Returns:
[Dataset] – A datasetops.Dataset
- datasetops.loaders.from_tensorflow(tf_dataset)
Create dataset from a Tensorflow dataset
- Arguments:
tf_dataset {tf.data.Dataset} – A Tensorflow dataset to load from
- Raises:
AssertionError: Raises error if Tensorflow is not executing eagerly
- Returns:
[Dataset] – A datasetops.Dataset
- datasetops.loaders.from_folder_data(path: datasetops.types.AnyPath) datasetops.dataset.Dataset
Load data from a folder with the data structure:
folder |- sample1.jpg |- sample2.jpg
- Arguments:
path {AnyPath} – path to folder
- Returns:
- Dataset – A dataset of data paths,
e.g. (‘nested_folder/class1/sample1.jpg’)
- datasetops.loaders.from_folder_class_data(path: datasetops.types.AnyPath) datasetops.dataset.Dataset
Load data from a folder with the data structure:
nested_folder |- class1
- datasetops.loaders.from_folder_dataset_class_data(path: datasetops.types.AnyPath) datasetops.types.List[datasetops.dataset.Dataset]
Load data from a folder with the data structure:
nested_folder |- dataset1
- datasetops.loaders._dataset_from_np_dict(data: datasetops.types.Dict[str, numpy.ndarray], data_keys: datasetops.types.List[str], label_key: str = None, name: str = None) datasetops.dataset.Dataset
- datasetops.loaders.from_mat_single_mult_data(path: datasetops.types.AnyPath) datasetops.types.List[datasetops.dataset.Dataset]
Load data from .mat file consisting of multiple data.
E.g. a .mat file with keys [‘X_src’, ‘Y_src’, ‘X_tgt’, ‘Y_tgt’]
- Arguments:
path {AnyPath} – path to .mat file
- Returns:
- List[Dataset] – A list of datasets, where a dataset was created for each suffix
e.g. a dataset with data from the keys (‘X_src’, ‘Y_src’) and from (‘X_tgt’, ‘Y_tgt’)