FaceStylizer for building face stylization model.

model_spec Specification for the model.
model_options Model options for creating face stylizer.
hparams The hyperparameters for training face stylizer.

w_avg An average face latent code to regularize face generation in face stylization.



View source

Creates and trains a face stylizer with input datasets.

train_data The input style image dataset for training the face stylizer.
options The options to configure face stylizer.

A FaceStylizer instant with the trained model.


View source

Converts the model to TFLite and exports as a model bundle file.

Saves a model bundle file and metadata json file to hparams.export_dir. The resulting model bundle file will contain necessary models for face detection, face landmarks detection, and customized face stylization. Only the model bundle file is needed for the downstream face stylization task. The metadata.json file is saved only to interpret the contents of the model bundle file. The face detection model and face landmarks detection model are from and the customized face stylization model is trained in this library.

model_name Face stylizer model bundle file name. The full export path is {self._hparams.export_dir}/{model_name}.


View source

Stylizes the images represented by the input dataset.

data Dataset of input images, can contain multiple images.

A dataset contains the stylized images