471eb9eb52267041d68d1ffad116cd29330fca30,stylize_image.py,,,#,10

Before Change


    args = parser.parse_args()

    logger.info("Loading model from %s" % args.model_checkpoint)
    transfer_net = models.StyleTransferNetwork.build(
        args.img_height, args.img_width
    )
    transfer_net.load_weights(args.model_checkpoint)

    inputs = [transfer_net.input, keras.backend.learning_phase()]
    outputs = [transfer_net.output]

After Change


    args = parser.parse_args()

    logger.info("Loading model from %s" % args.model_checkpoint)
    custom_objects = {
        "InstanceNormalization":
            keras_contrib.layers.normalization.InstanceNormalization,
        "DeprocessStylizedImage": layers.DeprocessStylizedImage
    }
    transfer_net = keras.models.load_model(
        args.model_checkpoint,
        custom_objects=custom_objects
    )

    image_size = transfer_net.input_shape[1:3]

    inputs = [transfer_net.input, keras.backend.learning_phase()]
    outputs = [transfer_net.output]

    transfer_style = keras.backend.function(inputs, outputs)

    input_image = utils.load_image(
        args.input_image,
        image_size[0],
        image_size[1],
        expand_dims=True
    )
    output_image = transfer_style([input_image, 1])[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: fritzlabs/fritz-models
Commit Name: 471eb9eb52267041d68d1ffad116cd29330fca30
Time: 2018-08-27
Author: jamesontoole@gmail.com
File Name: stylize_image.py
Class Name:
Method Name:


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 84c43177c6cc611daf5e141339065d8969b3c089
Time: 2018-06-18
Author: akitsch@google.com
File Name: tasks/pull_queue_snippets.py
Class Name:
Method Name: lease_task


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6f9eacfd1d5f6ebf961d134f538e7613c0b9fc25
Time: 2019-01-07
Author: d.sanche14@gmail.com
File Name: kms/api-client/quickstart.py
Class Name:
Method Name: run_quickstart