Terminal Interface

stransfer

Style Transfer

stransfer [OPTIONS] COMMAND [ARGS]...

fast-st

Fast Style Transfer

stransfer fast-st [OPTIONS] COMMAND [ARGS]...

convert-image

Converts the image at image-path using the network pretrained with style-name and saves the resulting transformed image in out-dir.

A pretrained model should exist in data/models/ for the specified style-name.

The files in data/models/ contain the style names in their file names. For example, fast_st_the_great_wave_epoch1.pth was trained with the style the_great_wave

stransfer fast-st convert-image [OPTIONS] IMAGE_PATH STYLE_NAME

Options

-o, --out-dir <out_dir>

The results directory where the converted image will be saved

Arguments

IMAGE_PATH

Required argument

STYLE_NAME

Required argument

train

Perform the training for the fast style transfer network. A checkpoint will be created at the end of each epoch in the data/models/ directory.

stransfer fast-st train [OPTIONS] STYLE_IMAGE_PATH

Options

-e, --epochs <epochs>

How many epochs the training will take

-b, --batch-size <batch_size>

Batch size for training

-cw, --content-weight <content_weight>

The weight we will assign to the content loss during the optimization

-sw, --style-weight <style_weight>

The weight we will assign to the style loss during the optimization

Arguments

STYLE_IMAGE_PATH

Required argument

gatys-st

Run the original Gatys style transfer (slow). Both style-image and content-image should be the paths to the image we want to take the content from and the one we want to take the style from (respectively).

stransfer gatys-st [OPTIONS] CONTENT_IMAGE_PATH STYLE_IMAGE_PATH

Options

-n, --out-name <out_name>

The name of the result file (transformed image)

-s, --steps <steps>

How many iterations should the optimization go through.

-cw, --content-weight <content_weight>

The weight we will assign to the content loss during the optimization

-sw, --style-weight <style_weight>

The weight we will assign to the style loss during the optimization

Arguments

CONTENT_IMAGE_PATH

Required argument

STYLE_IMAGE_PATH

Required argument

video-st

Video Style Transfer

stransfer video-st [OPTIONS] COMMAND [ARGS]...

convert-video

Converts the video at video-path using the network pretrained with style-name and saves the resulting transformed video in out-dir.

A pretrained model should exist in data/models/ for the specified style-name.

The files in data/models/ contain the style names in their file names. For example, video_st_starry_night_epoch3.pth was trained with the style starry_night

stransfer video-st convert-video [OPTIONS] VIDEO_PATH STYLE_NAME

Options

-o, --out-dir <out_dir>

The results directory where the converted style will be saved

--fps <fps>

The FPS that will be used when saving the transformed video

Arguments

VIDEO_PATH

Required argument

STYLE_NAME

Required argument

train

Perform the training for the video style transfer network. A checkpoint will be created at the end of each epoch in the data/models/ directory.

We have the possibility of starting the training process for video style transfer from pretrained weights for a fast style transfer trained with the same style name. The weights that will be used are those of the highest epoch which correspond to that style_name.

stransfer video-st train [OPTIONS] STYLE_IMAGE_PATH

Options

-e, --epochs <epochs>

How many epochs the training will take

-b, --batch-size <batch_size>

Batch size for training

-cw, --content-weight <content_weight>

The weight we will assign to the content loss during the optimization

-sw, --style-weight <style_weight>

The weight we will assign to the style loss during the optimization

-tw, --temporal-weight <temporal_weight>

The weight we will assign to the temporal loss during the optimization

--use-pretrained-fast-st

States whether we want to start training the video model from pretrained fast style transfer weights (which was trained on the same style name)

Arguments

STYLE_IMAGE_PATH

Required argument