Package fontai
This package contains the codebase of an end-to-end ML pipeline to train generative models for text font generation from open source font files scrapped from the internet. All of the ML stages, from ingestion to model training are designed to be run from configuration files and can be concatenated through a Pipeline class; correct configuration semantics for each one are enforced by the fontai.config
submodule. A brief overview of the submodules is below:
fontai.config
: Parsers that map YAML configuration files to object wrappers for all the dependencies that the corresponding ML stage needs to be executed either in batch or streaming mode; it makes heavy use of the strictyaml
and pydantic
libraries.
fontai.io
: Contains logic pertaining to data interfaces between ML stages and storage and to other ML stages; this comprises supported Tensorflow record formats, file formats, storage media and file reader and writer classes.
fontai.runners
: High-level ML stage executors are here, as well as the basic interfaces that each one has to implement.
fontai.prediction
: Contains the logic for preprocessing Tensorflow examples and get them ready for model training or scoring; also defines custom model architectures and callback functions for training.
fontai.preprocessing
: Contains the logic for mapping zipped font files to labeled character images ready to be ingested for model training.
Expand source code
"""This package contains the codebase of an end-to-end ML pipeline to train generative models for text font generation from open source font files scrapped from the internet. All of the ML stages, from ingestion to model training are designed to be run from configuration files and can be concatenated through a Pipeline class; correct configuration semantics for each one are enforced by the `config` submodule. A brief overview of the submodules is below:
`config`: Parsers that map YAML configuration files to object wrappers for all the dependencies that the corresponding ML stage needs to be executed either in batch or streaming mode; it makes heavy use of the `strictyaml` and `pydantic` libraries.
`io`: Contains logic pertaining to data interfaces between ML stages and storage and to other ML stages; this comprises supported Tensorflow record formats, file formats, storage media and file reader and writer classes.
`runners`: High-level ML stage executors are here, as well as the basic interfaces that each one has to implement.
`prediction`: Contains the logic for preprocessing Tensorflow examples and get them ready for model training or scoring; also defines custom model architectures and callback functions for training.
`preprocessing`: Contains the logic for mapping zipped font files to labeled character images ready to be ingested for model training.
"""
Sub-modules
fontai.config
-
The configuration module is the middle man between the provided YAML configuration files and instantiated ML stages ready to be executed. Submodules …
fontai.deployment
-
This module provides some utility functions to explore generative typeface models in an interactive Dash application.
fontai.entrypoints
-
This module provides entry points to the package to facilitate usage.
fontai.evaluation
fontai.io
-
This module contains classes that form the data interfaces between ML stages and the outside world (read: storage and other ML stages). Most objects …
fontai.prediction
-
This submodule contains Tensorflow-related classes that preprocess and format model inputs and define custom Keras models and callbacks. Arbitrary …
fontai.preprocessing
-
his submodule contains processing logic that maps zipped font files to Tensorflow record files containing images and character labels, ready to be …
fontai.runners
-
This module contains high level classes representing ML stages, and a
Pipeline
class that can run multiple stages sequentially. These stages are …