fontr package

FontR

Subpackages

Submodules

fontr.datasets module

class FileWithDirAsLabel(filepath)[source]

Bases: AbstractDataSet

__init__(filepath)[source]
class GoogleDriveDataset(filepath, file_name)[source]

Bases: AbstractVersionedDataSet

__init__(filepath, file_name)[source]

Creates a new instance of AbstractVersionedDataSet.

Parameters:
  • filepath (str) – Filepath in POSIX format to a file.

  • version – If specified, should be an instance of kedro.io.core.Version. If its load attribute is None, the latest version will be loaded. If its save attribute is None, save version will be autogenerated.

  • exists_function – Function that is used for determining whether a path exists in a filesystem.

  • glob_function – Function that is used for finding all paths in a filesystem, which match a given pattern.

exists()[source]

Checks whether a data set’s output already exists by calling the provided _exists() method.

Return type:

bool

Returns:

Flag indicating whether the output already exists.

Raises:

DataSetError – when underlying exists method raises error.

class KedroPytorchImageDataset(filepath, path_column=0, label_column=1, fs_args=None, credentials=None, transform=None, target_transform=None, return_labels=True)[source]

Bases: Dataset, AbstractDataSet

__init__(filepath, path_column=0, label_column=1, fs_args=None, credentials=None, transform=None, target_transform=None, return_labels=True)[source]

torch.utils.data.Dataset mixed with kedro.io.AbstractDataSet. filepath should be a CSV listing paths of images relative to the directory of filepath in the first column. The optional label_column column can contain labels for the images. The images should be located in the directory mentioned before. TODO fix this docstring.

target_transform(label)[source]
Return type:

Tensor

transform(img)[source]
Return type:

Tensor

with_transforms(transform=None, target_transform=None)[source]
Return type:

KedroPytorchImageDataset

class TorchPickleModelDataset(filepath, map_location='cpu', fs_args=None, credentials=None)[source]

Bases: AbstractDataSet

Kedro DataSet for a model to be (de-)serialized with torch.{load,save}

__init__(filepath, map_location='cpu', fs_args=None, credentials=None)[source]
class TorchScriptModelDataset(filepath, map_location='cpu', fs_args=None, credentials=None)[source]

Bases: AbstractDataSet

Kedro DataSet for a model to be (de-)serialized with torch.jit.{load,save}

__init__(filepath, map_location='cpu', fs_args=None, credentials=None)[source]

fontr.pipeline_registry module

Project pipelines.

register_pipelines()[source]

Register the project’s pipelines.

Return type:

Dict[str, Pipeline]

Returns:

A mapping from pipeline names to Pipeline objects.

fontr.settings module

File needed by kedro