turicreate.style_transfer.create

turicreate.style_transfer.create(style_dataset, content_dataset, style_feature=None, content_feature=None, max_iterations=None, model='resnet-16', verbose=True, batch_size=1, **kwargs)

Create a StyleTransfer model.

Parameters:
style_dataset: SFrame

Input style images. The columns named by the style_feature parameters will be extracted for training the model.

content_dataset : SFrame

Input content images. The columns named by the content_feature parameters will be extracted for training the model.

style_feature: string

Name of the column containing the input images in style SFrame. ‘None’ (the default) indicates the only image column in the style SFrame should be used as the feature.

content_feature: string

Name of the column containing the input images in content SFrame. ‘None’ (the default) indicates the only image column in the content SFrame should be used as the feature.

max_iterations : int

The number of training iterations. If ‘None’ (the default), then it will be automatically determined based on the amount of data you provide.

model : string optional

Style transfer model to use:

  • “resnet-16” : Fast and small-sized residual network that uses
    VGG-16 as reference network during training.
batch_size : int, optional

If you are getting memory errors, try decreasing this value. If you have a powerful computer, increasing this value may improve training throughput.

verbose : bool, optional

If True, print progress updates and model details.

Returns:
out : StyleTransfer

A trained StyleTransfer model.

See also

StyleTransfer

Examples

# Create datasets
>>> content_dataset = turicreate.image_analysis.load_images('content_images/')
>>> style_dataset = turicreate.image_analysis.load_images('style_images/')

# Train a style transfer model
>>> model = turicreate.style_transfer.create(content_dataset, style_dataset)

# Stylize an image on all styles
>>> stylized_images = model.stylize(data)

# Visualize the stylized images
>>> stylized_images.explore()